这是从wp-admin/admin.php
文件并在admin_init
行动
以下是核心屏幕部分的内联文档:
/**
* Fires before a particular screen is loaded.
*
* The load-* hook fires in a number of contexts. This hook is for core screens.
*
* The dynamic portion of the hook name, `$pagenow`, is a global variable
* referring to the filename of the current page, such as \'admin.php\',
* \'post-new.php\' etc. A complete hook for the latter would be
* \'load-post-new.php\'.
*
* @since 2.1.0
*/
do_action( "load-{$pagenow}" );
当我们访问时
/wp-admin/customize.php
生成的操作为
load-customize.php
.
然后,我们可以检查是否已使用以下工具启动:
did_action( \'load-customize.php\' );
它返回在页面加载期间到目前为止已激发的次数。
检查code reference 有关的详细信息did_action()
.
另一个例子是wp-admin/edit.php
以及相应的load-edit.php
行动