From 64482a6bdbe7989d8bcbe74d00be53e0302aa038 Mon Sep 17 00:00:00 2001 From: Anthony Talarico Date: Tue, 16 Jan 2018 15:28:30 -0500 Subject: [PATCH] filter was accidentally added to wrong addon, removed and moved here front hook filter for getting cities and cities associated to contacts --- setup/frontHooks.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 530bc7d..a2c661a 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -74,7 +74,13 @@ 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)" + ); + return $contactCities; +}); add_filter( 'glm-member-db-contacts-get-contact-data', function( $contact_id ){ require_once GLM_MEMBERS_CONTACTS_PLUGIN_CLASS_PATH . '/data/dataContacts.php'; $contactData = new GlmDataContacts( $this->wpdb, $this->config ); -- 2.17.1