WordPress – what actually happens at index.php

WordPress Includes List

18 Jul 2013


Next Up

WordPress includes output

Earlier this week, whilst working on a custom MVC framework project for WordPress, we took at look at some of the inner workings of how WordPress includes and readies itself for execution from the moment you hit “index.php”.

The result may shock you. We ran a simple get_included_files() function from our index.php in the theme folder and the result is what you see below. You can find out more about the get_included_files() PHP function here – http://php.net/manual/en/function.get-included-files.php

Crazy stuff, that’s a whole lot of includes! What’s interesting to note is that plugin’s get included before the pluggable.php wp-includes/ and the way WordPress attempts ‘routing’ is done via the template-loader.php file, which is pretty much called just before the index.php of your theme.