So I am trying to get rid of a font that a plugin is loading on the front end as I am already loading it myself and it loads every style of the font which I don't need.
Here is my code:
//Remove open sans
function custom_dequeue() {
wp_dequeue_style('et-gf-open-sans');
}
add_action( 'wp_enqueue_scripts', 'custom_dequeue' );
//I've also tried
add_action( 'wp_print_styles', 'custom_dequeue', 9999 );
//Also hooking into: wp_footer, wp_head, wp_print_scripts,
//all with high priority and default priority to no avail
All these do is move the code from the head to just before the closing </body>
tag.
I've contacted the plugin author and the response was the code I already tried. Waiting on another response.
Also, I am positive that I am dealing with the correct handle name. I changed the url of the code so I could locate exactly which line it was that was loading the font. (author has multiple spots that load fonts.)
Any Ideas?
---------------------------------------------
Edit
It gets loaded with this action:
add_action( 'wp_enqueue_scripts', array( $this, 'load_scripts_styles' ) );
And it is enqueued in the function load_scripts_styles
I have tried a high priority on everything.
I'm also using a plugin called query monitor which outputs the order of all the hooks and what plugin is hooking into what along with the function that is doing the hooking. My code is appearing after the plugins code yet all that happens is that it gets moved from the header to the footer. Driving me nuts!
'wp_enqueue_scripts'
action hook? I only ask because you didn't show or mention it explicitly. Most plugins and themes these days do styles via that hook, so you're very close, you can add the priority there too.