This filter is used in billing to get contact data for notices.
}
return $content;
}, 10, 4);
-?>
+add_filter( 'glm-member-db-contacts-get-contact-data-by-refdest', function( $ref_dest ){
+ require_once GLM_MEMBERS_CONTACTS_PLUGIN_CLASS_PATH . '/data/dataContacts.php';
+ $contactData = new GlmDataContacts( $this->wpdb, $this->config );
+ $contact_id = $this->wpdb->get_var(
+ $this->wpdb->prepare(
+ "SELECT id
+ FROM " . GLM_MEMBERS_CONTACTS_PLUGIN_DB_PREFIX . "contacts
+ WHERE ref_dest = %d",
+ $ref_dest
+ )
+ );
+ if ( $contact_id ) {
+ $contacts = $contactData->getEntry( $contact_id );
+ } else {
+ $contacts = array();
+ }
+ return $contacts;
+} );