I'm just trying to get my head around the "life-cycle" of a typical page request in WordPress. The Action Reference page lists 38 actions that occur during a typical page load, but two things aren't clear to me:

  • does functions.php get invoked before any of the hooks are executed?
  • does the framework call your "page.php", etc., somewhere within the sequence of hooks, or after all hooks have been executed?

Thanks.

(apologies if my terminology is a little off, but I believe I understand the idea behind hooks being made available by the framework, and actions being associated with these hooks by the theme author)

To see both when an action is fired and when a file is included, take a look here:

http://wp-roadmap.com/demo/

Note that it only covers things inside WP Core, along with the default theme.

does functions.php get invoked before any of the hooks are executed?

It is processed during theme(s) load, right before after_setup_theme hook.

does the framework call your "page.php", etc., somewhere within the sequence of hooks, or after all hooks have been executed?

If I am not mistaken specific template is determined and processed in template_redirect hook.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.