woocommerce_product_query_meta_query
- by admin
- 0
Used to filter meta queries for woocommerce. Queries in “prefix_postmeta “ table .
Sample
add_filter(‘woocommerce_product_query_meta_query’ , ‘hide_outofstock_from_best_sellers’,10,2);
function hide_outofstock_from_best_sellers($meta_query,$q){
global $wp_query;
$meta_query[‘stock_status’] =
array( array(
‘key’ => ‘_stock_status’,
‘value’ => ‘outofstock’,
‘compare’ => ‘NOT IN’
));
return $meta_query;
}
Used to filter meta queries for woocommerce. Queries in “prefix_postmeta “ table . Sample add_filter(‘woocommerce_product_query_meta_query’ , ‘hide_outofstock_from_best_sellers’,10,2); function hide_outofstock_from_best_sellers($meta_query,$q){ global $wp_query; $meta_query[‘stock_status’] = array( array( ‘key’ => ‘_stock_status’, ‘value’ => ‘outofstock’, ‘compare’ => ‘NOT IN’ )); return $meta_query; }
Used to filter meta queries for woocommerce. Queries in “prefix_postmeta “ table . Sample add_filter(‘woocommerce_product_query_meta_query’ , ‘hide_outofstock_from_best_sellers’,10,2); function hide_outofstock_from_best_sellers($meta_query,$q){ global $wp_query; $meta_query[‘stock_status’] = array( array( ‘key’ => ‘_stock_status’, ‘value’ => ‘outofstock’, ‘compare’ => ‘NOT IN’ )); return $meta_query; }