Created
July 30, 2013 07:35
-
-
Save shrwnsan/6111002 to your computer and use it in GitHub Desktop.
WordPress: Printout enqueued styles and scripts via their $handle.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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