From 882298361b15770dde7d04e7f06ae2279e386eca Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Tue, 22 Aug 2017 13:26:26 -0400 Subject: [PATCH] UASORT on the cities/counties in the top-search Uasort function applied to the arrays used to populate the cities and counties in the top-search to make sure they're alpha-ordered. --- functions.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/functions.php b/functions.php index e066afd..66626cf 100644 --- a/functions.php +++ b/functions.php @@ -366,12 +366,19 @@ add_filter('member_list_header_search', function(){ $cities = get_categories_array( apply_filters('glm_getListForSearch', 'city'), 'city'); $counties = get_categories_array( apply_filters('glm_getListForSearch', 'county'), 'county'); + uasort($regions, function ($item1, $item2) { + if ($item1['name'] == $item2['name']) return 0; + return $item1['name'] < $item2['name'] ? -1 : 1; + }); + uasort($cities, function ($item1, $item2) { + if ($item1['name'] == $item2['name']) return 0; + return $item1['name'] < $item2['name'] ? -1 : 1; + }); uasort($counties, function ($item1, $item2) { if ($item1['name'] == $item2['name']) return 0; return $item1['name'] < $item2['name'] ? -1 : 1; }); - $parks = get_categories_array( apply_filters('glm_getListForSearch','category', "Parks"), 'category'); $activities = get_categories_array( apply_filters('glm_getListForSearch','category', "Activities"), 'category'); $destinations = get_categories_array( apply_filters('glm_getListForSearch','category', "Destinations"), 'category'); -- 2.17.1