Created
September 4, 2016 07:35
-
-
Save ravishakya/332b37887f96e7c48e00b338fae5f0f4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'woocommerce_product_query', 'so_27971630_product_query' ); | |
function so_27971630_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 ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment