Skip to content

Instantly share code, notes, and snippets.

@tradesouthwest
Last active June 18, 2020 16:42
Show Gist options
  • Save tradesouthwest/acecde215afcc9d438516e02cad3614e to your computer and use it in GitHub Desktop.
Save tradesouthwest/acecde215afcc9d438516e02cad3614e to your computer and use it in GitHub Desktop.
wp get registered script tags and display at top of website page
<?php
/*
* Getting registered script tags and display at top of website page for dev only.
* Thanks http://wordpress.stackexchange.com/questions/54064/how-do-i-get-the-handle-for-all-enqueued-scripts
*/
add_action( 'wp_print_scripts', 'wsds_detect_enqueued_scripts' );
function wsds_detect_enqueued_scripts() {
global $wp_scripts;
foreach( $wp_scripts->queue as $handle ) :
echo $handle . ' | ';
endforeach;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment