Skip to content

Instantly share code, notes, and snippets.

@wpflippercode
Created September 13, 2017 07:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Sort Location Listing by Extra Field Phone Number
// Sort by extra field. e.g "phone".
add_filter('wpgmp_sorting','wpgmp_sorting_extra_field',3,2);
function wpgmp_sorting_extra_field($sorting,$map) {
$sorting['phone__asc__num'] ="Phone A-Z";
$sorting['phone__desc__num'] ="Phone Z-A";
return $sorting;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment