Skip to content

Commit

Permalink
Merge pull request #100 from strangerstudios/dev
Browse files Browse the repository at this point in the history
Update master to 1.3.1
  • Loading branch information
andrewlimaza authored Aug 12, 2019
2 parents efaad87 + 5ca5c50 commit 345569a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 4 deletions.
22 changes: 20 additions & 2 deletions pmpro-approvals.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 .= ' (<a href="' . admin_url( 'admin.php?page=pmpro-approvals&s=' . urlencode( $user->user_email ) ) . '">' . __( 'Pending', 'pmpro-approvals' ) . '</a>)';
}

Expand Down
10 changes: 8 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 345569a

Please sign in to comment.