Advertisement
wkoehn

Display enqueued scripts and styles on page

Nov 14th, 2019
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.42 KB | None | 0 0
  1. <?php
  2.     // scripts
  3.     global $wp_scripts;
  4.     echo "<h2>Enqueued JS Scripts</h2><ul>";
  5.     foreach( $wp_scripts->queue as $handle ) :
  6.         echo "<li>" . $handle . "</li>";
  7.     endforeach;
  8.     echo "</ul>";
  9.     // styles
  10.     global $wp_styles;
  11.     echo "<h2>Enqueued CSS Stylesheets</h2><ul>";
  12.     foreach( $wp_styles->queue as $handle ) :
  13.         echo "<li>" . $handle . "</li>";
  14.     endforeach;
  15.     echo "</ul>";
  16. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement