From: Anthony Talarico Date: Tue, 16 Jan 2018 20:28:30 +0000 (-0500) Subject: filter was accidentally added to wrong addon, removed and moved here X-Git-Tag: v1.1.7^2~13 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=64482a6bdbe7989d8bcbe74d00be53e0302aa038;p=WP-Plugins%2Fglm-member-db-contacts.git filter was accidentally added to wrong addon, removed and moved here front hook filter for getting cities and cities associated to contacts --- 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 );