admin管理员组文章数量:1426195
Is there any way to list which scripts and styles have been enqueued, while within wp-admin?
For example this code works, but only if you are on the frontend. How could I get the same list while staying in wp-admin?
function dc_list_scripts() {
global $wp_scripts;
$enqueued_scripts = array();
foreach ( $wp_scripts->queue as $handle ) {
$enqueued_scripts[ $handle ]['handle'] = $wp_scripts->registered[ $handle ]->handle;
$enqueued_scripts[ $handle ]['src'] = $wp_scripts->registered[ $handle ]->src;
}
print_r( $enqueued_scripts );
}
add_action( 'wp_print_scripts', 'dc_list_scripts' );
If I run the above code in wp-admin then I get a list of scripts and styles enqueued within wp-admin. That's not what I want, I need to know which resources are enqueued for the frontend.
本文标签: wp adminList All Enqueued Scripts and Styles
版权声明:本文标题:wp admin - List All Enqueued Scripts and Styles 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745459815a2659271.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论