I can’t tell you how many times I’ve had to look back and establish the process in my mind when building plugins or themes. I’ve done it so many times that you’d think I’d just remember it but I don’t — I always have to go spend a few minutes reminding myself. So, here’s a very quick reference for me (and maybe you!) to look back on when in need…
plugins_loaded hook fires
setup_theme hook fires
The theme’s functions.php file is included in wp-settings.php. If using a child theme, the child theme is loaded first.
after_setup_theme hook fires
init hook fires
wp_loaded hook fires
The wp()
function is invoked in wp-blog-header.php
wp hook fires
The wp-includes/template-loader.php file is included in wp-blog-header.php
template_redirect hook fires