geo-query
geo-query copied to clipboard
Move the order parameter out of geo_query part of WP_Query
Instead of:
$args = [
'geo_query' => array(
'order' => 'DESC', // Order by distance
],
];
$query = new WP_Query( $args );
we should use the ordering support of WP_Query
, e.g.
$args = [
'orderby' => array( 'distance' => 'ASC', 'title' => 'DESC' ),
'geo_query' => [... ]
];
$query = new WP_Query( $args );