From 5826febd080f3f0491d361bac00ee2194bf6b6dc Mon Sep 17 00:00:00 2001 From: Chuck Scott Date: Thu, 28 Feb 2019 11:17:57 -0500 Subject: [PATCH] Now showing only first instance of Custom Fields filter called with debug. Use VERBOSE to see all. --- setup/commonHooks.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/setup/commonHooks.php b/setup/commonHooks.php index 39798b2..b21be5f 100644 --- a/setup/commonHooks.php +++ b/setup/commonHooks.php @@ -202,8 +202,15 @@ add_filter( 'glm-members-customfields-form-store', function( $content, $fid, $re */ add_filter( 'glm-members-customfields-form-data-recall', function( $content, $fid, $recordId = 0, $priorityDisplay = false ){ - if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG) { - trigger_error('Custom Fields Filter Called: glm-members-customfields-form-data-recall', E_USER_NOTICE); + // If debug VERBOSE show all instances - othewise only the first. + if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE) { + trigger_error('Custom Fields Filter Called: (Verbose debug - showing all instances) glm-members-customfields-form-data-recall', E_USER_NOTICE); + } else { + static $customFieldsFilterCalled = false; + if (GLM_MEMBERS_PLUGIN_FRONT_DEBUG && !$customFieldsFilterCalled) { + trigger_error('Custom Fields Filter Called: (shown only once - use GLM_MEMBERS_PLUGIN_FRONT_DEBUG_VERBOSE to show all instances) glm-members-customfields-form-data-recall', E_USER_NOTICE); + $customFieldsFilterCalled = true; + } } require_once GLM_MEMBERS_CUSTOMFIELDS_PLUGIN_CLASS_PATH.'/data/dataCustomFields.php'; -- 2.17.1