How can I get all enqueued styles or scripts and then deregister them all at once?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
I hope you know what you are doing. You can wp_print_styles and wp_print_scripts action hooks and then get the global $wp_styles and $wp_scripts object variables in their respective hooks. The "registered" attribute lists registered scripts and the "queue" attribute lists queue scripts on both of the above objects. An example code to empty the scripts and style queue.
|
|||||||||||
|
|
You can also do it on a per basis by finding the handlers being called upon, search for
Hameedullah solution is better, however if you run into problems due to some scripts not loading give the above a shot. |
||||
|
|
