From 2f0146a49f4c6976c47ced524f4e2a3a05547cb9 Mon Sep 17 00:00:00 2001 From: Jason Coleman Date: Mon, 3 Jun 2019 15:47:56 -0400 Subject: [PATCH] Catching cases where the pmpro levels page is not set (i.e. 0) --- includes/restrictions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/restrictions.php b/includes/restrictions.php index fd24472..5d1e1bb 100644 --- a/includes/restrictions.php +++ b/includes/restrictions.php @@ -195,7 +195,7 @@ function pmpro_bp_buddypress_or_pmpro_registration() { $pmpro_bp_register = get_option( 'pmpro_bp_registration_page' ); - if( !empty( $pmpro_bp_register ) && $pmpro_bp_register == 'buddypress' && ( $post->ID == $pmpro_pages['levels'] ) && !is_user_logged_in() ) { + if( !empty( $pmpro_bp_register ) && $pmpro_bp_register == 'buddypress' && $post->ID != 0 && $post->ID == $pmpro_pages['levels'] && !is_user_logged_in() ) { //Use BuddyPress Register page wp_redirect( get_permalink( $bp_pages['register'] ) ); exit;