Update $wp_users_object after creating a new user.
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.
- You must be logged in to reply to this topic.