Skip to content
Home » News » WordPress 2.1 Include File Reorganization

WordPress 2.1 Include File Reorganization

Ryan Boren, from Automattic, is working on WordPress, and has recently mentioned a major shift in how include files are going to be in the 2.1 development cycle.

we’ve been tidying up our includes. They had gotten rather messy, with a bazillion functions being piled into the functions.php catch-all. Go take a look at trunk and see how things have changed. functions.php is much slimmer, and we have a few more files. We tried to separate the presentation from the backend logic a little better. For example, comment functions that perform DB operations go in comment.php. Comment functions that spit out markup go in comment-template.php. Pretty straightforward. All of the “big query” and “post loop” related functions are gathered in query.php. Rewrite functions are in rewrite.php, plugin functions are in plugin.php, and so on. This is nothing that end-users care about, but I feel cleaner.

It is always nice to have include files for things so that code is easier to find and easier to manage. I can hear the happy cheers of developers and other people that love to mess around with WordPress code.