Related to the previous post on removing actions from particular hook on particular page, I was doing this trick when working on WooCommerce Newsletter Generator for Hijapedia Store.

This is what I learned so far:

  1. All styles are registered and queued to $wp_styles global variable.
  2. In similar fashion, all scripts are registered and queued to $wp_scripts global variable

This is how to implement those lessons above:

  1. Hook an action, make sure that you hook it late so all stylesheets and scripts have been enqueued
  2. Loop the queued stylesheets / scripts, and dequeue em using wp_dequeue_style() and wp_dequeue_script()

That’s that. Here’s how I did it:

Share Your Thought