From e92222e0ac08f152fd85767c0bcfba2f7e75ea30 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Tue, 10 Jul 2018 12:12:02 -0400 Subject: [PATCH] Add order by clause to city name filter For list of city names used in the city search filter on front end. --- setup/frontHooks.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/setup/frontHooks.php b/setup/frontHooks.php index a2c661a..a1baf41 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -77,7 +77,12 @@ if (isset($this->config['addOns']['glm-member-db'])) { add_filter( 'glm-member-contact-cities', function(){ global $wpdb; $contactCities = $wpdb->get_results( - "SELECT id, name FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "cities WHERE id IN (SELECT city FROM ".GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . "contacts WHERE active = true)" + "SELECT id, name + FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "cities + WHERE id IN (SELECT city + FROM ".GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . "contacts + WHERE active = true) + ORDER BY name" ); return $contactCities; }); -- 2.17.1