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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 |
index.php wp-blog-header.php wp-load.php wp-config.php wp-settings.php wp-includes/load.php wp-includes/default-constants.php wp-includes/version.php wp-includes/compat.php wp-includes/functions.php wp-includes/option.php wp-includes/class-wp.php wp-includes/class-wp-error.php wp-includes/plugin.php wp-includes/pomo/mo.php wp-includes/pomo/translations.php wp-includes/pomo/entry.php wp-includes/pomo/streams.php wp-includes/wp-db.php wp-includes/cache.php wp-includes/default-filters.php wp-includes/l10n.php wp-includes/class-wp-walker.php wp-includes/class-wp-ajax-response.php wp-includes/formatting.php wp-includes/capabilities.php wp-includes/query.php wp-includes/theme.php wp-includes/class-wp-theme.php wp-includes/template.php wp-includes/user.php wp-includes/meta.php wp-includes/general-template.php wp-includes/link-template.php wp-includes/author-template.php wp-includes/post.php wp-includes/post-template.php wp-includes/post-thumbnail-template.php wp-includes/category.php wp-includes/category-template.php wp-includes/comment.php wp-includes/comment-template.php wp-includes/rewrite.php wp-includes/feed.php wp-includes/bookmark.php wp-includes/bookmark-template.php wp-includes/kses.php wp-includes/cron.php wp-includes/deprecated.php wp-includes/script-loader.php wp-includes/class.wp-dependencies.php wp-includes/class.wp-scripts.php wp-includes/functions.wp-scripts.php wp-includes/class.wp-styles.php wp-includes/functions.wp-styles.php wp-includes/taxonomy.php wp-includes/update.php wp-includes/canonical.php wp-includes/shortcodes.php wp-includes/class-wp-embed.php wp-includes/media.php wp-includes/http.php wp-includes/class-http.php wp-includes/widgets.php wp-includes/nav-menu.php wp-includes/nav-menu-template.php wp-includes/admin-bar.php wp-includes/vars.php wp-includes/pluggable.php wp-includes/pluggable-deprecated.php wp-includes/default-widgets.php wp-includes/locale.php themes/rocketmen-default/functions.php wp-includes/class-wp-admin-bar.php wp-includes/template-loader.php wp-content/themes/rocketmen-default/index.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.