Skip to:
Content

BuddyPress.org

Ticket #4809: buddypress-1.6.4-loop-to-register.patch

File buddypress-1.6.4-loop-to-register.patch, 1.3 KB (added by tometzky, 8 years ago)

Proposed patch.

  • buddypress/bp-members/bp-members-functions.php

    old new  
    13591359        if ( is_admin() || is_network_admin() )
    13601360                return;
    13611361
    1362         // Not at the WP core signup page and action is not register
    1363         if ( ! empty( $_SERVER['SCRIPT_NAME'] ) && false === strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php' ) && ( 'register' != $action ) )
    1364                 return;
     1362        // Is it WP core signup page?
     1363        if ( empty( $_SERVER['SCRIPT_NAME'] ) ) {
     1364                $is_wp_signup = false;
     1365        } else {       
     1366                $is_wp_signup = ( false !== strpos( $_SERVER['SCRIPT_NAME'], 'wp-signup.php' ) );
     1367        }
    13651368
    1366         // Redirect to sign-up page
    1367         if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) )
    1368                 bp_core_redirect( bp_get_signup_page() );
     1369        // Only redirect at the WP core signup page or when action is register
     1370        if ( ( $is_wp_signup ) || ( 'register' === $action ) ) {
     1371                // Redirect to buddypress sign-up page
     1372                if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) )
     1373                        bp_core_redirect( bp_get_signup_page() );
     1374        }
    13691375}
    13701376add_action( 'bp_init', 'bp_core_wpsignup_redirect' );
    13711377