Merge pull request #18888 from woocommerce/fix/18859
Don't prepend cats for regular shortcodes
This commit is contained in:
commit
170cf2d361
|
@ -482,6 +482,16 @@ class WC_Template_Loader {
|
|||
return $content;
|
||||
}
|
||||
|
||||
/**
|
||||
* Are we filtering content for unsupported themes?
|
||||
*
|
||||
* @since 3.3.2
|
||||
* @return bool
|
||||
*/
|
||||
public static function in_content_filter() {
|
||||
return (bool) self::$in_content_filter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prevent the main featured image on product pages because there will be another featured image
|
||||
* in the gallery.
|
||||
|
@ -491,7 +501,7 @@ class WC_Template_Loader {
|
|||
* @return string
|
||||
*/
|
||||
public static function unsupported_theme_single_featured_image_filter( $html ) {
|
||||
if ( self::$in_content_filter || ! is_product() || ! is_main_query() ) {
|
||||
if ( self::in_content_filter() || ! is_product() || ! is_main_query() ) {
|
||||
return $html;
|
||||
}
|
||||
|
||||
|
|
|
@ -1818,6 +1818,10 @@ if ( ! function_exists( 'woocommerce_maybe_show_product_subcategories' ) ) {
|
|||
* @return string
|
||||
*/
|
||||
function woocommerce_maybe_show_product_subcategories( $loop_html ) {
|
||||
if ( wc_get_loop_prop( 'is_shortcode' ) && ! WC_Template_Loader::in_content_filter() ) {
|
||||
return $loop_html;
|
||||
}
|
||||
|
||||
$display_type = woocommerce_get_loop_display_mode();
|
||||
|
||||
// If displaying categories, append to the loop.
|
||||
|
|
Loading…
Reference in New Issue