Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Filter Elementor query by ACF [WordPress]
//custom-query-name is set in Elementor as query ID
add_action( 'elementor/query/custom-query-name', function( $query ) {
$meta_query = (array)$query->get('meta_query');
$meta_query[] = array(
'key' => 'custom_field',
'value' => '',
'compare' => '!=',
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.