For example,any "naked" code, i.e.:

IF ($_POST) then....,

runs directly, before any WP action. for example, this runs later (even with point 1):


I want to execute my code before any WP action starts. Which hook executes at first?

  • Maybe this: if(condition) add_action($tag, $callback_function, $priority); ? in your case: if(isset($_POST["data"])) add_action('init','my_functionnn',1);
    – Ismail
    Jun 27, 2015 at 17:42
  • 2
    Small hint. The plugin Debug Objects list the hooks in his order, helpful to find and understanding hooks.
    – bueltge
    Jun 27, 2015 at 18:50
  • 1
    Really? You are asking essentially the same question twice after you got such excellent answers the last time?
    – fuxia
    Jun 27, 2015 at 19:32
  • @toscho , probably I have forgot that.. thanks.. however, this was a bit different thing, to know, if there exists something, that runs before "NAKED" code (which is put in functions.php or plugin)...
    – T.Todua
    Jun 27, 2015 at 19:42

2 Answers 2


Generally after_setup_theme is the first action hook available to themes, triggered immediately after the active theme's functions.php file is loaded. At this stage, the current user is not yet authenticated.


init runs before admin_init

There's different ways to verify this using code or a plugin.

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