The Basics of How WordPress Works

If you’re getting started in WordPress development, odds are it won’t be long until you bump up against the concept of hooks. That is, points during the WordPress life cycle that allow us to add our own functionality to customize how WordPress behaves.

Of course, this is how both themes and plugins are made to do some of the neat (or not so neat, depending on the project) things that they do. And though I obviously recommend reading up on them in the Codex, I think it’s also important to understand how the WordPress application loads itself.

More specifically, I think it’s important to understand how WordPress works. There are a lot of resources out there available to read and review; however, John Blackbourn has been working on a no-frills version of this very idea that I believe to be worth starring and referencing.

How WordPress Works

In short, John’s put together a short document and made it available via GitHub that walks us through the WordPress initialization and request process.

How WordPress Works

As you’ll see via the link above, the document outlines the flow of control throughout the WordPress process. The document moves from initialization into how the request is processed, how the main query performs its work, then how templates are loaded.

Obviously, this is a high-level look and what’s happening in the application while its working and it’s completely possible for us to walk through the WordPress source code to glean this information. But that takes a significant amount of time and understanding in order to decipher what the code is doing (especially if you’re new to WordPress development).

Documents like this help us to have references for what’s happening and when it’s happening and can ultimately contribute to making us better at what we do.

Don’t forget, since it’s on GitHub, it’s open for comments and commits.