Instantly share code, notes, and snippets.

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