最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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.

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.

Share Improve this question asked Jan 7, 2021 at 19:38 morpheusmorpheus 1557 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

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.

发布评论

评论列表(0)

  1. 暂无评论