Opened 14 years ago
Closed 14 years ago
#17967 closed defect (bug) (worksforme)
Ignoring the user ID in wp_create_user
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Priority: | normal | |
| Severity: | normal | Version: | 3.1.4 |
| Component: | Users | Keywords: | reporter-feedback |
| Focuses: | Cc: |
Description
Hello
If you use this function, Ignores old users.
The new user will replace the previous
With all the information
wp_create_user
Change History (4)
#2
@
14 years ago
Replying to scribu:
Please provide some example code that demonstrates this behaviour.
// variable for test
$user_name = $_POST['author_user_name'];
$password = wp_generate_password();
$email = $_POST['author_user_email'];
// function test
$user_id = wp_create_user($user_name, $password, $email) ;
// check error
if ( is_wp_error($user_id) ){
$register_error = $user_id->get_error_message();
echo $register_error;
} else {
_e('Thankd!');
}
#3
@
14 years ago
check to see if the user exists before creating a user: username_exists($username)
I cant reproduce this however.
this:
var_dump( wp_create_user('admin', 'password', 'test2@localhost') );
results in:
object(WP_Error)[104]
public 'errors' =>
array
'existing_user_login' =>
array
0 => string 'This username is already registered.' (length=36)
public 'error_data' =>
array
empty
Note: See
TracTickets for help on using
tickets.
Please provide some example code that demonstrates this behaviour.