From: Laury GvR Date: Wed, 12 Apr 2017 19:25:53 +0000 (-0400) Subject: Added a check to make the id passed to glm_custom_fields filter default to 0 X-Git-Tag: v1.0.0^2~24 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/index.cgi?a=commitdiff_plain;h=e529cc34b2a87d47b92b80fb2a1967267b0cbec3;p=WP-Plugins%2Fglm-member-db-fields.git Added a check to make the id passed to glm_custom_fields filter default to 0 --- diff --git a/setup/frontHooks.php b/setup/frontHooks.php index 16e2422..0b950bf 100644 --- a/setup/frontHooks.php +++ b/setup/frontHooks.php @@ -73,7 +73,7 @@ add_filter('glm-member-db-front-search-query', function($queryParts) { } return $queryParts; }); -add_filter('glm_custom_fields', function($attribute, $id) { +add_filter('glm_custom_fields', function($attribute, $id = 0) { global $wpdb; $query = "SELECT field_data FROM " . GLM_MEMBERS_FIELDS_PLUGIN_DB_PREFIX . "custom_field_data WHERE ref_dest = $id " @@ -85,7 +85,7 @@ add_filter('glm_custom_fields', function($attribute, $id) { 2 ); add_filter('glm_custom_fields_member_types', function() { - + $query = "SELECT name FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "member_type"; $result = $this->wpdb->get_results( $query, ARRAY_A ); return $result;