Created
July 31, 2015 07:41
-
-
Save ooooak/91abbd1aba3c9b0d0ba8 to your computer and use it in GitHub Desktop.
create user in wordpress
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$user = array( | |
'user_login' => admin_theme_user_manager::generate_username($username), | |
'user_pass' => wp_generate_password(5, false), | |
'user_email' => $subscriber['user_email'], | |
'first_name' => $subscriber['first_name'], | |
'last_name' => $subscriber['last_name'], | |
); | |
$user_id = wp_insert_user($user); | |
if(is_wp_error($user_id)){ | |
return false; | |
} | |
return $user_id; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment