Skip to:
Content
Pages
Categories
Search
Top
Bottom

Update $wp_users_object after creating a new user.


  • ELundby45
    Member

    @elundby45

    Hello,

    I have tried searching for this, but I am having no luck. Any insight would be greatly appreciated.

    So I am currently creating a new user by:

    $new_id = bb_new_user( $user_name, $user_email, ”, 0);

    I have verified that the user is properly being created and ‘$new_id’ contains the right user ID.

    However, when I attempt to retrieve the user by:

    $user = $wp_users_object->get_user($new_id);

    Nothing is returned and $user is set to 0.

    I have tried several other methods of retrieving the user and am having the same effect. Including:

    $user = $wp_users_object->get_user( $user_name, array( ‘by’ => ‘login’ ) );

    $user = $wp_users_object->get_user( $user_email, array( ‘by’ => ‘email’ ) );

    Any suggestions? Thank you in advance.

Viewing 2 replies - 1 through 2 (of 2 total)

  • ELundby45
    Member

    @elundby45

    I have tried to accomplish this about 60 different ways. As of now I am assuming this is something wrong with BBPress, unless someone can shed some light on what i’m doing wrong.

    I will have to switch to using a different forum if this cannot be resolved.

    Why wouldn’t this work?

    $new_id = bb_new_user( $user_name, $user_email, ”, 0);

    $user = bb_get_user($new_id);

    I receive “user does not exist” when trying to login. However if I try again, I am able to login.

    PS. Why does it say this thread was started by someone else (aion4217)?


    ELundby45
    Member

    @elundby45

    I have tried to accomplish this about 60 different ways. As of now I am assuming this is something wrong with BBPress, unless someone can shed some light on what i’m doing wrong.

    I will have to switch to using a different forum if this cannot be resolved.

    Why wouldn’t this work?

    $new_id = bb_new_user( $user_name, $user_email, ”, 0);

    $user = bb_get_user($new_id);

    I receive “user does not exist” when trying to login. However if I try again, I am able to login.

    PS. Why does it say this thread was started by someone else (aion4217)?

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.