@brand-dedication : Hi Noahj,
The plugin has indirect support for hiding broken shortcodes as they may appear in other places, via the hide_broken_shortcodes_filters
filter.
In your case, this would be accomplished with a few lines of (untested) code added somewhere on the site (perhaps in an mu-plugin, or less ideally in the theme’s functions.php file):
/**
* Hides broken shortcodes that appear in WooCommerce product short descriptions.
*
* @param array $filters Filters that get their broken shortcodes hidden.
* @return array
*/
function hide_broken_shortcodes_in_woocommerce_short_description( $filters ) {
$filters[] = 'woocommerce_short_description';
return $filters;
}
add_filter( 'hide_broken_shortcodes_filters', 'hide_broken_shortcodes_in_woocommerce_short_description' );
The point of the hide_broken_shortcodes_filters
filter was to provide a way for the plugin’s functionality to be able to be extended to other places. There are probably hundreds of other situations where broken shortcodes could/should be hidden, but accounting for them all is not feasible.
You could argue that WooCommerce is a large enough plugin that it should warrant exception. It’s something I could be swayed about at some point, but currently there haven’t been any other identical requests from others for this.
Does the above code get you the results you wanted? I only skimmed the WooCommerce code to find what looks like the relevant bit, so I may not have chosen the appropriate filter.