diff --git a/includes/class-wc-shortcodes.php b/includes/class-wc-shortcodes.php index aa2effa3d0d..598c738d039 100644 --- a/includes/class-wc-shortcodes.php +++ b/includes/class-wc-shortcodes.php @@ -345,10 +345,16 @@ class WC_Shortcodes { 'value' => array_map( 'trim', explode( ',', $atts['skus'] ) ), 'compare' => 'IN' ); + + // Ignore catalog visibility + $query_args['meta_query'] = WC()->query->stock_status_meta_query(); } if ( ! empty( $atts['ids'] ) ) { $query_args['post__in'] = array_map( 'trim', explode( ',', $atts['ids'] ) ); + + // Ignore catalog visibility + $query_args['meta_query'] = WC()->query->stock_status_meta_query(); } return self::product_loop( $query_args, $atts, 'products' );