The default CSS is registered with an wp_ajax_ action. To remove it, we must first wait until we are sure the action has taken place – e.g. by using the wp_loaded hook. Then, we can remove the action we don’t like. I do it like this:
add_action('wp_loaded', function () {
remove_all_actions('wp_ajax_gridfrontendCSS');
remove_all_actions('wp_ajax_nopriv_gridfrontendCSS');
});
-
This reply was modified 8 years, 8 months ago by
philippze.
Hi,
you can simply add an empty /grid/default-frontend.css in your theme or the cleaner way is to use wp_dequeue_style(‘grid_frontend’)
https://developer.wordpress.org/reference/functions/wp_dequeue_style/
Hi Edward,
I’ve checked it again, but wp_dequeue_style will not work.
The reason is that the CSS files are not included with wp_enqueue_style, but with wp_ajax_... actions. This happens here.
wp_ajax works differently, see the docs.
-
This reply was modified 8 years, 8 months ago by
philippze.