Last active
August 29, 2015 14:21
-
-
Save bdeleasa/a575f47874681001cd5a to your computer and use it in GitHub Desktop.
Functions to print all enqueued scripts and styles.
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 | |
// 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