• 1.
    /* SHOW HANDLES FOR JS AND CSS */
  • 2.
    /* http://wpengineer.com/2308/debug-enqueued-scripts-and-styles-in-wordpress/ */
  • 3.
    /* http://wordpress.stackexchange.com/questions/54064/how-do-i-get-the-handle-for-all-enqueued-scripts?atw=1 */
  • 4.
    function wpa54064_inspect_scripts() {
  • 5.
       if ( current_user_can( 'administrator' ) ) {
  • 6.
          global $wp_scripts, $wp_styles;
  • 7.
             echo 'Names for enqueued scripts<br />';
  • 8.
          foreach( $wp_scripts->queue as $handle ) :
  • 9.
             echo $handle . '<br />';
  • 10.
          endforeach;
  • 11.
             echo '<br />Names for enqueued styles<br />';
  • 12.
          foreach( $wp_styles->queue as $handle ) :
  • 13.
             echo $handle . '<br />';
  • 14.
          endforeach;
  • 15.
       }
  • 16.
    }
  • 17.
    add_action( 'wp_footer', 'wpa54064_inspect_scripts' );
/* SHOW HANDLES FOR JS AND CSS */ /* http://wpengineer.com/2308/debug-enqueued-scripts-and-styles-in-wordpress/ */ /* http://wordpress.stackexchange.com/questions/54064/how-do-i-get-the-handle-for-all-enqueued-scripts?atw=1 */ function wpa54064_inspect_scripts() { if ( current_user_can( 'administrator' ) ) { global $wp_scripts, $wp_styles; echo 'Names for enqueued scripts<br />'; foreach( $wp_scripts->queue as $handle ) : echo $handle . '<br />'; endforeach; echo '<br />Names for enqueued styles<br />'; foreach( $wp_styles->queue as $handle ) : echo $handle . '<br />'; endforeach; } } add_action( 'wp_footer', 'wpa54064_inspect_scripts' );

Copy Code to Clipboard Raw

Sign-in or Create a Free Account.

Snippi uses Twitter or Facebook to register and create accounts. Registration will enable you to keep track of your snippets. We never spam your timeline or wall. Ever.

Sign-in with Facebook Sign-in with Twitter