Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

woocommerce_product_query

function bd_change_product_query( $q ){
  
  $meta_query = $q->get( 'meta_query' );
  
  $meta_query[] = array(
    'key' => 'custom_acf_key',
    'value' => 'custom_acf_value',
    'compare' => '='
  );
  
  $q->set( 'meta_query', $meta_query );
}

add_action( 'woocommerce_product_query', 'bd_change_product_query' )
Source by bizdirect.pro #
 
PREVIOUS NEXT
Tagged:
ADD COMMENT
Topic
Name
2+3 =