Skip to content

Commit

Permalink
Merge pull request #61 from messica/1.2.4
Browse files Browse the repository at this point in the history
1.2.4
  • Loading branch information
messica authored Jun 29, 2019
2 parents 2f0146a + 0a79b6d commit 31cdbb0
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
38 changes: 37 additions & 1 deletion includes/profiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,40 @@ function pmpro_bp_xprofile_updated_profile( $user_id, $posted_field_ids, $errors
}
}
}
add_action( 'xprofile_updated_profile', 'pmpro_bp_xprofile_updated_profile', 1, 5 );
add_action( 'xprofile_updated_profile', 'pmpro_bp_xprofile_updated_profile', 1, 5 );

/**
* Filter edit profile link based on user's BuddyPress access.
*
* @since 1.2.4
*/
function pmpro_bp_init_edit_profile_url() {

global $current_user;

$user_options = pmpro_bp_get_user_options( $current_user->ID );

if ( PMPROBP_LOCK_ALL_ACCESS == $user_options['pmpro_bp_restrictions'] ) {
remove_filter( 'edit_profile_url', 'bp_members_edit_profile_url', 10, 3 );
}
}
add_action( 'init', 'pmpro_bp_init_edit_profile_url' );

/**
* Remove "Extended Profile" tab based on user's BuddyPress access.
*
* @since 1.2.4
*/
function pmpro_bp_profile_nav() {

global $current_user, $bp;

$user_options = pmpro_bp_get_user_options( $current_user->ID );

if ( PMPROBP_LOCK_ALL_ACCESS == $user_options['pmpro_bp_restrictions'] ) {
remove_action( 'edit_user_profile', array( $bp->members->admin, 'profile_nav' ), 99, 1 );
remove_action( 'show_user_profile', array( $bp->members->admin, 'profile_nav' ), 99, 1 );
}
}
add_action( 'edit_user_profile', 'pmpro_bp_profile_nav' );
add_action( 'show_user_profile', 'pmpro_bp_profile_nav' );
5 changes: 3 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Contributors: strangerstudios, great-h-master
Tags: paid memberships pro, pmpro, buddypress
Requires at least: 4
Tested up to: 5.2.1
Tested up to: 5.2.2
Stable tag: 1.2.4

Manage access to your BuddyPress Community using Paid Memberships Pro
Expand Down Expand Up @@ -99,7 +99,8 @@ This plugin also allows you to use the BuddyPress user registration process (in

== Changelog ==

= 1.2.4 =
= 1.2.4 - 2019-06-28 =
* BUG FIX: Fixed issue where the WP profile was still being restricted from users without access to BP.
* BUG FIX: Fixed issue where the 'restrict all of BuddyPress' setting wasn't being applied correctly when levels were set to use non-member settings.

= 1.2.3 =
Expand Down

0 comments on commit 31cdbb0

Please sign in to comment.