Skip to content

Instantly share code, notes, and snippets.

@wpflippercode
Created September 13, 2017 07:03
Show Gist options
  • Save wpflippercode/13ef5cc21d797035490b93b430ae8074 to your computer and use it in GitHub Desktop.
Save wpflippercode/13ef5cc21d797035490b93b430ae8074 to your computer and use it in GitHub Desktop.
Sort Locations Listing by City in Ascending & Decending Order
// Sort by city.
add_filter('wpgmp_sorting','wpgmp_sorting_location_field',2,2);
function wpgmp_sorting_location_field($sorting,$map) {
$sorting['city__asc'] ="City A-Z";
$sorting['city__desc'] ="City Z-A";
return $sorting;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment