Skip to:
Content

BuddyPress.org

Changeset 3666


Ignore:
Timestamp:
01/06/2011 03:17:09 PM (11 years ago)
Author:
boonebgorges
Message:

Refactors registration.php requires so they don't require an additional function. Fixes #2997. Props nacin

Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity.php

    r3661 r3666  
    547547
    548548    if ( $usernames = bp_activity_find_mentions( strip_tags( $activity->content ) ) ) {
    549         bp_core_maybe_include_user_registration_file();
     549        if ( ! function_exists( 'username_exists' ) )
     550            require_once( ABSPATH . WPINC . '/registration.php' );
    550551
    551552        foreach( (array)$usernames as $username ) {
  • trunk/bp-activity/bp-activity-filters.php

    r3661 r3666  
    114114 */
    115115function bp_activity_at_name_filter( $content ) {
    116     bp_core_maybe_include_user_registration_file();
     116    if ( ! function_exists( 'username_exists' ) )
     117        require_once( ABSPATH . WPINC . '/registration.php' );
    117118
    118119    $usernames = bp_activity_find_mentions( $content );
  • trunk/bp-blogs/bp-blogs-templatetags.php

    r3661 r3666  
    325325    global $current_user, $current_site;
    326326    global $bp;
    327 
    328     bp_core_maybe_include_user_registration_file();
    329327
    330328    if ( isset($_POST['submit']) ) {
  • trunk/bp-core.php

    r3661 r3666  
    283283
    284284    return apply_filters( 'bp_core_get_page_names', $pages );
    285 }
    286 
    287 /**
    288  * If we're not on WordPress 3.1+, then include the file containing the user registration methods.
    289  *
    290  * @global float $wp_version WordPress version number
    291  * @since 1.3
    292  */
    293 function bp_core_maybe_include_user_registration_file() {
    294     global $wp_version;
    295 
    296     if ( $wp_version >= 3.1 )
    297         return;
    298 
    299     require_once( ABSPATH . WPINC . '/registration.php' );
    300285}
    301286
  • trunk/bp-core/bp-core-settings.php

    r3661 r3666  
    5252        check_admin_referer('bp_settings_general');
    5353
    54         bp_core_maybe_include_user_registration_file();
     54        if ( ! function_exists( 'email_exists' ) )
     55            require_once( ABSPATH . WPINC . '/registration.php' );
    5556
    5657        // Form has been submitted and nonce checks out, lets do it.
  • trunk/bp-core/bp-core-signup.php

    r3661 r3666  
    3535        /* Check the nonce */
    3636        check_admin_referer( 'bp_new_signup' );
    37 
    38         bp_core_maybe_include_user_registration_file();
    3937
    4038        /* Check the base account details for problems */
     
    217215    /* Check if an activation key has been passed */
    218216    if ( isset( $_GET['key'] ) ) {
    219 
    220         bp_core_maybe_include_user_registration_file();
    221217
    222218        /* Activate the signup */
     
    353349    global $wpdb;
    354350
     351    if ( ! function_exists( 'validate_username' ) )
     352        require_once( ABSPATH . WPINC . '/registration.php' );
     353
    355354    $errors = new WP_Error();
    356355    $user_email = sanitize_email( $user_email );
     
    430429    } else {
    431430        $errors = new WP_Error();
     431
     432        if ( ! function_exists( 'wp_insert_user' ) )
     433            require_once( ABSPATH . WPINC . '/registration.php' );
    432434
    433435        $user_id = wp_insert_user( array(
     
    537539    }
    538540
    539     /* Update the user_url and display_name */
     541    // Update the user_url and display_name
     542    // Support for WP < 3.1
     543    if ( ! function_exists( 'wp_update_user' ) )
     544        require_once( ABSPATH . WPINC . '/registration.php' );
     545       
    540546    wp_update_user( array( 'ID' => $user_id, 'user_url' => bp_core_get_user_domain( $user_id ), 'display_name' => bp_core_get_user_displayname( $user_id ) ) );
    541547
  • trunk/bp-core/bp-core-templatetags.php

    r3651 r3666  
    12791279        extract( $r, EXTR_SKIP );
    12801280
    1281         $signup_avatar_dir = ( !empty( $_POST['signup_avatar_dir'] ) ) ? $_POST['signup_avatar_dir'] : $bp->signup->avatar_dir;
     1281        if ( !empty( $_POST['signup_avatar_dir'] ) ) {
     1282            $signup_avatar_dir = $_POST['signup_avatar_dir'];
     1283        } else if ( !empty( $bp->signup->avatar_dir ) ) {
     1284            $signup_avatar_dir = $bp->signup->avatar_dir;
     1285        }
    12821286
    12831287        if ( empty( $signup_avatar_dir ) ) {
Note: See TracChangeset for help on using the changeset viewer.