Update filters for when no custom field plugin is there
authorSteve Sutton <steve@gaslightmedia.com>
Tue, 28 Mar 2017 19:49:15 +0000 (15:49 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Tue, 28 Mar 2017 19:49:15 +0000 (15:49 -0400)
Redoing the filters so if there's no field plugin then they don't output
anything.

classes/customFieldPluginSupport.php
setup/adminHooks.php

index 590deab..84e774a 100644 (file)
@@ -73,6 +73,9 @@ function customFieldsSaveMemberInfoFields( $memberId )
 function customFieldsGetMemberInfoFields( $memberId )
 {
     global $wpdb;
+    if ( !$memberId ) {
+        return false;
+    }
     $data = array();
     $sql = "
     SELECT *
index 22bcca9..e5e5f57 100644 (file)
  *
  *  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 = '<a id="glm-member-info-custom-fields" data-show-table="glm-table-custom-fields" class="glm-member-info-tab nav-tab">Custom Fields</a>';
     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 ){