From: Chuck Scott Date: Thu, 28 Feb 2019 16:17:57 +0000 (-0500) Subject: Now showing only first instance of Custom Fields filter called with debug. Use VERBOS... X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fdevelop;p=WP-Plugins%2Fglm-member-db-customfields.git Now showing only first instance of Custom Fields filter called with debug. Use VERBOSE to see all. --- 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';