Sales WP_Query show hidden product
-
Since this plugin is not compatible with shortcodes I am trying to create a sales page with a wp_query but product that should be hidden appear in the result.
What would be the argument to filter those in the query?
For info I am using this query:
$query_args = array(
‘posts_per_page’ => 8,
‘no_found_rows’ => 1,
‘post_status’ => ‘publish’,
‘post_type’ => ‘product’,
‘meta_query’ => WC()->query->get_meta_query(),
‘post__in’ => array_merge( array( 0 ), wc_get_product_ids_on_sale() )
);
$products = new WP_Query( $query_args );Thanks.
- The topic ‘Sales WP_Query show hidden product’ is closed to new replies.