Skip to:
Content

BuddyPress.org

Ticket #5374: 5374.signupid.diff

File 5374.signupid.diff, 1.6 KB (added by imath, 11 years ago)
  • bp-members/bp-members-functions.php

    diff --git bp-members/bp-members-functions.php bp-members/bp-members-functions.php
    index 2158c2f..3e2b4b6 100644
    function bp_core_validate_blog_signup( $blog_url, $blog_title ) { 
    14341434}
    14351435
    14361436function bp_core_signup_user( $user_login, $user_password, $user_email, $usermeta ) {
    1437         global $bp;
     1437        global $bp, $wpdb;
    14381438
    1439         // We need to cast $user_id to pass to the filters
    1440         $user_id = false;
     1439        // We need to cast $user_id & $signup_id to pass to the filters
     1440        $user_id = $signup_id = false;
    14411441
    14421442        // Multisite installs have their own install procedure
    14431443        if ( is_multisite() ) {
    14441444                wpmu_signup_user( $user_login, $user_email, $usermeta );
    14451445
     1446                if ( ! empty( $wpdb->insert_id ) ) {
     1447                        $signup_id = $wpdb->insert_id;
     1448                }
     1449
    14461450        } else {
    14471451                // Format data
    14481452                $user_login     = preg_replace( '/\s+/', '', sanitize_user( $user_login, true ) );
    function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet 
    14801484                        'meta'           => $usermeta,
    14811485                );
    14821486
    1483                 BP_Signup::add( $args );
     1487                $signup_id = BP_Signup::add( $args );
    14841488
    14851489                if ( apply_filters( 'bp_core_signup_send_activation_key', true ) ) {
    14861490                        bp_core_signup_send_validation_email( $user_id, $user_email, $activation_key );
    function bp_core_signup_user( $user_login, $user_password, $user_email, $usermet 
    14891493
    14901494        $bp->signup->username = $user_login;
    14911495
    1492         do_action( 'bp_core_signup_user', $user_id, $user_login, $user_password, $user_email, $usermeta );
     1496        do_action( 'bp_core_signup_user', $user_id, $user_login, $user_password, $user_email, $usermeta, $signup_id );
    14931497
    14941498        return $user_id;
    14951499}