[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' );