Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
List all enqueued scripts and styles
<?php
function yanco_list_styles() {
global $wp_styles;
echo "<h2>Enqueued CSS Stylesheets</h2><ul>";
foreach( $wp_styles->queue as $handle ) :
echo "<li>" . $handle . "</li>";
endforeach;
echo "</ul>";
}
if( !is_admin() ) add_action( 'wp_print_styles', 'yanco_list_styles' );
function yanco_list_scripts() {
global $wp_scripts;
echo "<h2>Enqueued JS Scripts</h2><ul>";
foreach( $wp_scripts->queue as $handle ) :
echo "<li>" . $handle . "</li>";
endforeach;
echo "</ul>";
}
if( !is_admin() ) add_action( 'wp_print_scripts', 'yanco_list_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.