Skip to content

Instantly share code, notes, and snippets.

@shrwnsan
Created July 30, 2013 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shrwnsan/6111002 to your computer and use it in GitHub Desktop.
Save shrwnsan/6111002 to your computer and use it in GitHub Desktop.
WordPress: Printout enqueued styles and scripts via their $handle.
function my_inspect_styles() {
global $wp_styles;
echo '<!-- Styles: ';
foreach( $wp_styles->queue as $handle ) {
echo $handle . ' | ';
}
echo '-->';
}
function my_inspect_scripts() {
global $wp_scripts;
echo '<!-- Scripts: ';
foreach( $wp_scripts->queue as $handle ) {
echo $handle . ' | ';
}
echo '-->';
}
add_action( 'wp_print_styles', 'my_inspect_styles' );
add_action( 'wp_print_scripts', 'my_inspect_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment