Added a check to make the id passed to glm_custom_fields filter default to 0
authorLaury GvR <laury@gaslightmedia.com>
Wed, 12 Apr 2017 19:25:53 +0000 (15:25 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Wed, 12 Apr 2017 19:25:53 +0000 (15:25 -0400)
setup/frontHooks.php

index 16e2422..0b950bf 100644 (file)
@@ -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;