作为对@Wyck answer的补充,您可以查看this explanation about how to determine on which admin UI page you currently are.
大多数脚本已注册,但未排队,因此未加载。只需在shutdown
通过倾倒$GLOBALS[\'wp_scripts\'];
.
您可以使用以下钩住此钩子的函数:
function debug_my_scripts()
{
global $wp_scripts;
$output[\'Registered\'] = var_export( array_keys( $wp_scripts->registered ), true );
$output[\'Enqueued\'] = var_export( $wp_scripts->queue, true );
$output[\'Done\'] = var_export( $wp_scripts->done, true );
foreach ( $output as $title => $data )
print "<h3>{$title}</h3><pre>{$data}</pre>";
}
if ( is_admin() )
add_action( \'shutdown\', \'debug_my_scripts\', 9999 );