Last active
November 25, 2022 09:59
-
-
Save robneu/8291089 to your computer and use it in GitHub Desktop.
Display a list of all currently enqueued script handles. Useful for manual minification when using Better WordPress Minify and other similar plugins.
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
<?php | |
/** | |
* Output a list of all enqueued script handles. | |
* | |
* @author FAT Media, LLC | |
* @global $wp_scripts | |
* @todo Change 'prefix' to your theme or plugin prefix. | |
*/ | |
function prefix_print_script_handles() { | |
global $wp_scripts; | |
// Loop through and display all script handles. | |
foreach( $wp_scripts->queue as $handle ) { | |
echo $handle . ' | '; | |
} | |
} | |
add_action( 'wp_print_scripts', 'prefix_print_script_handles' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment