From c4c6c930f7a417f92ab319166ec85f738e75f308 Mon Sep 17 00:00:00 2001 From: Theuns Date: Fri, 20 May 2022 13:12:22 +0200 Subject: [PATCH] Redirect from levels if user not registered Add additional logic to only redirect a user from the membership levels page if they are not logged in. --- includes/restrictions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/restrictions.php b/includes/restrictions.php index 2d86624..5b87c2b 100644 --- a/includes/restrictions.php +++ b/includes/restrictions.php @@ -255,7 +255,7 @@ function pmpro_bp_buddypress_or_pmpro_registration() { if ( $page_setting === 'buddypress' && $on_pmpro_levels ) { // Use the BuddyPress Register page. $bp_pages = get_option( 'bp-pages' ); - if ( ! empty( $bp_pages['register'] ) ) { + if ( ! empty( $bp_pages['register'] ) && ! is_user_logged_in() ) { $url = get_permalink( $bp_pages['register'] ); } else { $url = '';