geo-query icon indicating copy to clipboard operation
geo-query copied to clipboard

Move the order parameter out of geo_query part of WP_Query

Open birgire opened this issue 6 years ago • 0 comments

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 );


birgire avatar Nov 17 '17 17:11 birgire