• Resolved DamirCalusic

    (@webkreativ)


    Hi,

    I wonder how I can deregister/dequeue the mailpoet_public css aswell as the mailpoet_custom_fonts_css that are printed out in the body of the website?

    Best regards.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter DamirCalusic

    (@webkreativ)

    I have solved this really simple by altering the print styles filter.

    // Force removal of styles
    add_filter('print_styles_array', 'custom_print_styles_array');
    /**
     * Force removal of styles that are not enqued properly
     */
    function custom_print_styles_array($styles){
    	$styles_to_remove = array(	
    		'mailpoet_public',				// plugins/mailpoet
    		'mailpoet_custom_fonts_css' 	// plugins/mailpoet
    	);
    
    	if(is_array($styles) && count($styles) > 0){
    		foreach($styles as $key => $code){
    			if(in_array($code, $styles_to_remove)){
    				unset($styles[$key]);
    			}
    		}
    	}
    
    	return $styles;
    }
    mediengestalter

    (@mediengestalter)

    Doesn’t work for me..

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Remove stylesheet’ is closed to new replies.