From: Steve Sutton Date: Tue, 10 Jul 2018 16:12:02 +0000 (-0400) Subject: Add order by clause to city name filter X-Git-Tag: v1.1.12^2~16 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=e92222e0ac08f152fd85767c0bcfba2f7e75ea30;p=WP-Plugins%2Fglm-member-db-contacts.git Add order by clause to city name filter For list of city names used in the city search filter on front end. --- 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; });