Skip to content

Instantly share code, notes, and snippets.

@bdeleasa
Last active August 29, 2015 14:21
Show Gist options
  • Save bdeleasa/a575f47874681001cd5a to your computer and use it in GitHub Desktop.
Save bdeleasa/a575f47874681001cd5a to your computer and use it in GitHub Desktop.
Functions to print all enqueued scripts and styles.
<?php
// add_action( 'wp_print_scripts', 'rroots_print_enqueued_styles' );
/**
* Function for printing all enqueued styles. This is useful if you want to dequeue styles enqueued by plugins.
*
* @usage Uncomment the add_action following this function
* @params none
*/
function rroots_print_enqueued_styles() {
global $wp_styles;
foreach( $wp_styles->queue as $handle ) :
echo $handle . ' | ';
endforeach;
}
// add_action( 'wp_print_scripts', 'rroots_print_enqueued_scripts' );
/**
* Function for printing all enqueued scripts. This is useful if you want to dequeue scripts enqueued by plugins.
*
* @usage Uncomment the add_action following this function
* @params none
*/
function rroots_print_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