[wp-trac] [WordPress Trac] #2525: Restructure wp-includes

WordPress Trac wp-trac at lists.automattic.com
Thu Mar 2 11:50:40 GMT 2006

#2525: Restructure wp-includes
       Id:  2525            |      Status:  new                     
Component:  Administration  |    Modified:  Thu Mar  2 11:50:40 2006
 Severity:  normal          |   Milestone:  2.1                     
 Priority:  normal          |     Version:  2.0.1                   
    Owner:  ryan            |    Reporter:  ryan                    
 Our includes are rather chaotic.  functions.php has turned into a dumping
 ground for everything.  Let's impose some structure.

  * Database Query - Move get, set, update, add, delete functions together
 into one db.php file or break them into category-db.php, option-db.php,
 post-db.php, bookmark-db.php, etc.

  * WP Query - Move WP_Query class and all of the functions that wrap the
 wp_query object (is_*() and the loop functions) into query.php.

  * Theme, Stylesheet, Template - Move all of the theming related functions
 to theme.php.

  * Plugin - Move action and filter functions to plugin.php.

  * Rewrite/Link - Move WP_Rewrite and supporting functions into

  * Misc - Leave what's left in functions.php.

 I'd like to rename existing files while we're at it.  The "-functions"
 suffix and "functions-" prefix aren't necessary.  Let's try a three tier
 naming approach for the bookmark, category, option, post, page, and user

  * object-template.php - Template functions
  * object-helper.php - Helper funcs for the template funcs
  * object-db.php - DB functions that do the get and the set.

 We'd have these for each of our objects (bookmarks, categories, ...).
 Helper functions would be the middle men between the template and db
 functions.  We may not need separate files for helper funcs.

Ticket URL: <http://trac.wordpress.org/ticket/2525>
WordPress Trac <http://wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list