diff --git a/pmpro-approvals.php b/pmpro-approvals.php index 98c794b..1b1a11a 100644 --- a/pmpro-approvals.php +++ b/pmpro-approvals.php @@ -3,7 +3,7 @@ Plugin Name: Paid Memberships Pro - Approvals Add On Plugin URI: https://www.paidmembershipspro.com/add-ons/approval-process-membership/ Description: Grants administrators the ability to approve/deny memberships after signup. -Version: 1.3 +Version: 1.3.1 Author: Stranger Studios Author URI: https://www.paidmembershipspro.com Text Domain: pmpro-approvals @@ -468,6 +468,18 @@ public static function pmpro_has_membership_level( $haslevel, $user_id, $levels return $haslevel; } + // Only check this inside admin of WordPress. + if ( is_admin() ) { + + // Ignore if on the edit user screen. This will allow admins/users to update custom fields. + $current_screen = get_current_screen(); + + if ( $current_screen->base == 'user-edit' || $current_screen->base == 'profile' ) { + return $haslevel; + } + + } + //no user, skip if ( empty( $user_id ) ) { return $haslevel; @@ -1088,7 +1100,13 @@ public static function pmpro_members_list_user( $user ) { $status_in = apply_filters( 'pmpro_approvals_members_list_status', array( 'oldmembers', 'cancelled', 'expired' ) ); $level_type = isset( $_REQUEST['l'] ) ? $_REQUEST['l'] : ''; - if ( isset( $_REQUEST['page']) && $_REQUEST['page'] === 'pmpro-dashboard' && current_user_can( 'pmpro_approvals' ) && self::isPending( $user->ID, $user->membership_id ) && ! in_array( $level_type, $status_in ) ) { + // Bail if this is the dashboard page. + if ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] === 'pmpro-dashboard' ) { + return $user; + } + + // Show user status if the user is pending. + if ( current_user_can( 'pmpro_approvals' ) && self::isPending( $user->ID, $user->membership_id ) && ! in_array( $level_type, $status_in ) ) { $user->membership .= ' (' . __( 'Pending', 'pmpro-approvals' ) . ')'; } diff --git a/readme.txt b/readme.txt index d871cca..a67145f 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: strangerstudios, andrewza Tags: paid memberships pro, pmpro, approval, approvals, workflow Requires at least: 4.0 Tested up to: 5.2.2 -Stable tag: 1.3 +Stable tag: 1.3.1 Grants administrators the ability to approve/deny memberships after signup. @@ -35,7 +35,13 @@ Members pending approval will not have access to view members-only content until View full documentation at: https://www.paidmembershipspro.com/add-ons/approval-process-membership/ -== Changelog == +== Changelog == + += 1.3.1 - 2019-08-12 = +* BUG FIX: User approval status was not showing in the members list. +* BUG FIX: Edit user page was not showing custom fields from Register Helper. +* BUG FIX: Approval links not showing under members list and was hidden completely. + = 1.3 - 2019-07-23 = * SECURITY: Improved escaping when outputting data to the screen. * BUG FIX: Remove "Status" from account page if the user's level doesn't require approval.