Created
June 11, 2020 14:40
-
-
Save LeMiira/ab5168ed548be95a1c0eb983a363582f to your computer and use it in GitHub Desktop.
Custom meta query elementor
This file contains hidden or 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
add_action( 'elementor_pro/posts/query/relatedPostsDynamic', function( $query ) { | |
$meta_query[] = [ | |
'key' => 'mec_end_date', | |
'value' => date('Y-m-d'), | |
'compare' => '>=', | |
]; | |
$tax_query[] =[ | |
'taxonomy' => 'language', | |
'terms' => 22566, | |
'field' => 'term_taxonomy_id', | |
'operator' => 'IN' | |
]; | |
$query->set('tax_query', $tax_query); | |
$query->set('meta_query', $meta_query); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
add_action( 'elementor/query/brandProductsQuery', function( $query ) {
$meta_query[] = [
'key' => '_stock_status',
'value' => 'instock',
'compare' => '=',
];
$query->set('meta_query', $meta_query);
});