Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm looking for a documentation page where wordpress action lifecycle is explained. Does it exist?

I can't understand if init is called before admin_head or viceversa (even if the name is auto-explenatory in this case)

share|improve this question
add comment

2 Answers 2

The order and appearance of actions depend on the page and the loaded files.

get_search_form() for example fires an action 'get_search_form' and (oddly enough) also a filter 'get_search_form'. But if no search form is loaded the action will not be available.

The only way to really know which actions are available is to look at them on different pages. There is a magic action 'all' to hook into … well … all actions.
My plugin All Actions List does exactly this. It prints all actions found into the footer on the last action named 'shutdown' which is always available.

On the front page of a simple blog, there are ~2300 actions – including filters which may be used as actions too.

share|improve this answer
    
what about admininistration pages? is there any standard action flows? –  frabiacca Mar 20 '12 at 11:09
    
There is no defined standard. admin_init is usually there, 'admin_head' and 'admin_footer' too. –  toscho Mar 20 '12 at 12:12
add comment

Here you can find a list (in order) of the actions that get run during a typical page request in WordPress: http://codex.wordpress.org/Plugin_API/Action_Reference#Actions_Run_During_a_Typical_Request

Note that many actions are called multiple times at various times in the code. There is no such thing as a “one true linear action chain”.

share|improve this answer
    
the list under "Actions Run During a Typical Request " section reprents the ordered action calls, doesn't it? –  frabiacca Mar 19 '12 at 11:11
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.