From e529cc34b2a87d47b92b80fb2a1967267b0cbec3 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Wed, 12 Apr 2017 15:25:53 -0400 Subject: [PATCH] Added a check to make the id passed to glm_custom_fields filter default to 0 --- setup/frontHooks.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.17.1