Skip to content

Commit

Permalink
Revert a code change in a point release.
Browse files Browse the repository at this point in the history
* BUG FIX: Reverted a change that locked down the directory page in certain cases.
  • Loading branch information
andrewlimaza committed Sep 13, 2022
1 parent 88f6efa commit 6cf6699
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions includes/restrictions.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,7 @@ function pmpro_bp_bp_get_add_friend_button($args) {
* Redirect away from any BuddyPress page if set to.
*/
function pmpro_bp_lockdown_all_bp() {
global $bp, $current_user, $pmpro_pages;

// Return if BuddyPress is not active
if( empty( $bp ) ) {
return;
}
global $current_user, $pmpro_pages;

// Make sure PMPro is active.
if ( ! function_exists( 'pmpro_getMembershipLevelForUser' ) ) {
Expand Down Expand Up @@ -221,11 +216,6 @@ function pmpro_bp_lockdown_all_bp() {
pmpro_bp_redirect_to_access_required_page();
}

//Redirect away from the members page if no access is allowed
if( $bp->current_component == 'members' && pmpro_bp_is_member_directory_locked() ) {
pmpro_bp_redirect_to_access_required_page();
}

}
add_action( 'template_redirect', 'pmpro_bp_lockdown_all_bp', 50 );

Expand Down

0 comments on commit 6cf6699

Please sign in to comment.