Based on example here https://make.wordpress.org/core/2015/03/30/query-improvements-in-wp-4-2-orderby-and-meta_query/
I'd like to modify the query
$q = new WP_Query( array(
'meta_query' => array(
'relation' => 'AND',
'state_clause' => array(
'key' => 'state',
'value' => 'Wisconsin',
),
'city_clause' => array(
'key' => 'city',
'compare' => 'EXISTS',
),
),
'orderby' => 'city_clause') );
to be able to get all posts where state
is 'Wisconsin' OR state
is 'California' and ORDER BY population
DESC.
I'm failing in writing such query in WP.
Any tips would be much appreciated.