admin管理员组文章数量:1318994
I'm trying to write a new plugin and I get so confused about wp hooks to use. What is the difference between init hook and admin_init hook, which one is fired first?
I'm trying to write a new plugin and I get so confused about wp hooks to use. What is the difference between init hook and admin_init hook, which one is fired first?
Share Improve this question asked Oct 17, 2020 at 16:13 Boussif AsmaBoussif Asma 11 bronze badge1 Answer
Reset to default 1The init
hook is triggered a little earlier than the admin_init
. Between them is triggered wp_loaded
and few hooks related to updating the DB.
The init
hook fires when WP is finished loading (viewer-facing and administration side).
The admin_init
hook fires on administration side only (/wp-admin/*
), therefore is triggered also by front- and back-end ajax requests (/wp-admin/admin-ajax.php
) and POST handler (/wp-admin/admin-post.php
).
本文标签: pluginsWhat are admin hooks
版权声明:本文标题:plugins - What are admin hooks 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742054676a2418220.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论