WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

After the solution to this question was to get a function to launch BEFORE the init action is fired by taking the sequence out of its function, it got me thinking, is there any earlier in the WP load sequence that I can hook a function into?

share|improve this question
    
I really wish they would have added a plugin call before the whole system was loaded. – Xeoncross Jan 22 '12 at 4:00
up vote 6 down vote accepted

muplugins_loaded is the earliest hook.

Depending on your wordpress setup, you may not have any plugins in the MU_PLUGINS directory. In that case this hook may not fire.

The next best hook to trigger is plugins_loaded.

RESOURCES

  1. WordPress Codex - Action Reference List
  2. Q/A: How to get WordPress' hook run sequence?
  3. Q/A: Make sense of WP Load Core
share|improve this answer
5  
Yep, but note that it runs before loading of normal plugins and theme so it is somewhat useless in practice. plugins_loaded and after_setup_theme are earliest appropriate for normal plugins and theme accordingly. – Rarst Jul 21 '11 at 11:09
    
answer updated. check desired action with "Hooks run list". – tazo todua Jul 10 '15 at 15:10
    
This answer contains some very bad information. The muplugins_loaded action is not conditional on anything . It will fire. If there are no mu-plugins, though, I am not sure how you'd get code to run before early enough to use the hook. – s_ha_dum Jan 10 at 15:08

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.