Skip to content

Instantly share code, notes, and snippets.

@wpflippercode
Created September 13, 2017 07:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wpflippercode/e9b3ae79baa855a6a5271be42862e0db to your computer and use it in GitHub Desktop.
Save wpflippercode/e9b3ae79baa855a6a5271be42862e0db to your computer and use it in GitHub Desktop.
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