Custom Query Filter by user role
-
I would like to use the Custom Query Filter, to filter by user role:
https://developers.elementor.com/custom-query-filter/
Something like:
add_action( 'elementor/query/editors', function( $query ) { // Get current meta Query $meta_query = $query->get( 'meta_query' ); // Append our meta query $meta_query = array(); $meta_query[] = [ 'key' => 'role', 'value' => 'editor', 'compare' => 'in', ]; $query->set( 'meta_query', $meta_query ); } );Is this possible? Any help would be appreciated.
Thank you very much!
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Custom Query Filter by user role’ is closed to new replies.