也可以使用插件Debug Objects; 还列出脚本和样式。该插件有更多用于开发和调试的选项,还有此功能。
或者是这个来源,你可以找到关于这个主题的信息和帖子here:
add_action(\'wp_footer\', \'fb_urls_of_enqueued_stuff\');
add_action(\'admin_footer\', \'fb_urls_of_enqueued_stuff\');
function fb_urls_of_enqueued_stuff( $handles = array() ) {
global $wp_scripts, $wp_styles;
// scripts
foreach ( $wp_scripts -> registered as $registered )
$script_urls[ $registered -> handle ] = $registered -> src;
// styles
foreach ( $wp_styles -> registered as $registered )
$style_urls[ $registered -> handle ] = $registered -> src;
// if empty
if ( empty( $handles ) ) {
$handles = array_merge( $wp_scripts -> queue, $wp_styles -> queue );
array_values( $handles );
}
// output of values
$output = \'\';
foreach ( $handles as $handle ) {
if ( ! empty( $script_urls[ $handle ] ) )
$output .= $script_urls[ $handle ] . \'<br />\';
if ( ! empty( $style_urls[ $handle ] ) )
$output .= $style_urls[ $handle ] . \'<br />\';
}
echo $output;
}