When generating customer emails, WooCommmerce defines a set of tags here for which they apply a default hardcoded style.

/**
 * style_inline_tags function.
 *
 * @access public
 * @param array $tags
 * @return array
 */
function style_inline_tags($tags) {
    return array_unique( array_merge( $tags, array( 'h1', 'h2', 'h3', 'a', 'img' ) ) );
}

I need to change this style to match the rest of the email (ArialLucida Grande) so I want to eliminate all of this list so nothing gets the default look. I tried cutting these out in the plugin’s files to make sure that’s what I need and sure enough it worked. But at every update, I have to patch the WooCommerce code.

Based on Add hooks for overriding default email inline styles and Overriding email inline styles I’m trying to write a filter hook to remove these tags from the array and I can’t get it to work.

This is the code I added to the end of my theme’s functions.php

/**
 * Kill defaults
 **/
add_filter('woocommerce_email_style_inline_tags', 'kill_defaults');
function kill_defaults( $tags ) {
    $tags = array();
    return $tags;
}

Read more here: WooCommerce Email style - remove default styling


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , , ,

Wordpress related questions and answers: