Created
May 4, 2018 14:18
-
-
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
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
// 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