What event I can tap into that fires before loading wp-admin page?

I have some code that I need to execute. I am currently executing it in response to the template_redirect event. This is giving me desired result for pages other than /wp-admin. What event can I tap into that fires before wordpress starts processing /wp-admin? I need an event that will fire just before /wp-admin processing starts. Thanks.

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

The earliest admin related hook I can see is admin_menu, so before that comes (listing only useful core hooks, from later to earlier)

  • auth_redirect
  • update_option
  • wp_loaded
  • init
  • pre_get_posts
  • after_setup_theme
  • get_template_part
  • setup_theme
  • plugins_loaded
  • muplugins_loaded

What are you trying to do, exactly? the complete answer depends on your use case.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x