Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/08/2011 06:35:03 AM (14 years ago)
Author:
johnjamesjacoby
Message:

More auditing of _slug and _root_slug functions.

Introduce functions for updating '$bp->is_' globals to prevent loading $bp global in several functions.

Various phpDoc fixes and whitespace clean-up. (1.3 trunk)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/bp-members-signup.php

    r4056 r4088  
    11<?php
     2
     3/**
     4 * BuddyPress Member Sign-up
     5 *
     6 * Functions and filters specific to the member sign-up process
     7 *
     8 * @package BuddyPress
     9 * @subpackage Members
     10 */
    211
    312
     
    514    global $bp, $wpdb;
    615
    7     if ( $bp->current_component != BP_REGISTER_SLUG )
    8         return false;
    9 
    10     $bp->is_directory = false;
     16    if ( !bp_is_current_component( 'register' ) )
     17        return false;
     18
     19    // Not a directory
     20    bp_update_is_directory( false, 'register' );
    1121
    1222    if ( bp_is_component_front_page( 'register' ) && ( is_user_logged_in() || !bp_get_signup_allowed() ) )
    13         bp_core_redirect( bp_get_root_domain() . '/' . $bp->members->slug );
     23        bp_core_redirect( bp_get_root_domain() . '/' . bp_get_members_root_slug() );
    1424
    1525    // If the user is logged in, redirect away from here
     
    155165    global $bp, $wpdb;
    156166
    157     if ( BP_ACTIVATION_SLUG != $bp->current_component )
     167    if ( bp_is_current_component( 'activate' ) )
    158168        return false;
    159169
     
    167177        if ( !empty( $user->errors ) ) {
    168178            bp_core_add_message( $user->get_error_message(), 'error' );
    169             bp_core_redirect( bp_get_root_domain() . '/' . BP_ACTIVATION_SLUG );
     179            bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . $bp->pages->activate->slug ) );
    170180        }
    171181
     
    593603// Kill the wp-signup.php if custom registration signup templates are present
    594604function bp_members_wpsignup_redirect() {
     605    global $bp;
     606
    595607    $action = '';
    596608    if ( isset( $_GET['action'] ) )
     
    601613
    602614    if ( locate_template( array( 'registration/register.php' ), false ) || locate_template( array( 'register.php' ), false ) )
    603         bp_core_redirect( bp_get_root_domain() . '/' . BP_REGISTER_SLUG . '/' );
     615        bp_core_redirect( bp_get_root_domain() . '/' . $bp->pages->register->slug . '/' );
    604616}
    605617if ( is_multisite() )
Note: See TracChangeset for help on using the changeset viewer.