Skip to content

Commit

Permalink
Catching cases where the pmpro levels page is not set (i.e. 0)
Browse files Browse the repository at this point in the history
  • Loading branch information
ideadude committed Jun 3, 2019
1 parent 4ee5ff1 commit 2f0146a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/restrictions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2f0146a

Please sign in to comment.