Skip to content

Instantly share code, notes, and snippets.

@colorful-tones
Created May 4, 2018 14:18
Show Gist options
  • Save colorful-tones/a437f128edf7ac5c265fc7e61650df40 to your computer and use it in GitHub Desktop.
Save colorful-tones/a437f128edf7ac5c265fc7e61650df40 to your computer and use it in GitHub Desktop.
[Debug enqueue scripts] Quick debug for listing all enqueue'd scripts. #WordPress #enqueue
// Not for Production, right? 👻
function guacamole_inspect_scripts() {
global $wp_scripts, $wp_styles;
// Loop through all enqueue'd JS scripts and echo out.
foreach ( $wp_scripts->queue as $handle ) :
echo $handle . ' | ';
endforeach;
// Loop through all enqueue'd CSS styles and echo out.
foreach ( $wp_styles->queue as $handle ) :
echo $handle . ' | ';
endforeach;
}
add_action( 'wp_print_scripts', 'guacamole_inspect_scripts' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment