From: Steve Sutton Date: Tue, 28 Mar 2017 19:49:15 +0000 (-0400) Subject: Update filters for when no custom field plugin is there X-Git-Tag: v1.0.0^2~62 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=f755d70afc51ae9ac838afc4034bfc1aea7e91e2;p=WP-Plugins%2Fglm-member-db-fields.git Update filters for when no custom field plugin is there Redoing the filters so if there's no field plugin then they don't output anything. --- diff --git a/classes/customFieldPluginSupport.php b/classes/customFieldPluginSupport.php index 590deab..84e774a 100644 --- a/classes/customFieldPluginSupport.php +++ b/classes/customFieldPluginSupport.php @@ -73,6 +73,9 @@ function customFieldsSaveMemberInfoFields( $memberId ) function customFieldsGetMemberInfoFields( $memberId ) { global $wpdb; + if ( !$memberId ) { + return false; + } $data = array(); $sql = " SELECT * diff --git a/setup/adminHooks.php b/setup/adminHooks.php index 22bcca9..e5e5f57 100644 --- a/setup/adminHooks.php +++ b/setup/adminHooks.php @@ -25,15 +25,16 @@ * * Also note that parameters will be in the context of the main admin controller constructor. */ -add_filter( 'glm-member-db-member-info-custom-nav', function( $memberId ){ +add_filter( 'glm-member-db-member-info-custom-nav', function( $content ){ $out = 'Custom Fields'; return $out; }); -add_filter( 'glm-member-db-member-info-custom-tab', function( $memberId ){ +add_filter( 'glm-member-db-member-info-custom-tab', function( $content, $memberId = '' ){ + unset( $_REQUEST['glm_action'] ); $content = $this->controller( 'memberinfo', 'fields', $memberId ); return $content; -}); +},1,2); add_action( 'glm-member-db-member-info-save-custom-fields', function( $memberInfoId ){