Skip to content

Instantly share code, notes, and snippets.

@ooooak
Created July 31, 2015 07:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ooooak/91abbd1aba3c9b0d0ba8 to your computer and use it in GitHub Desktop.
Save ooooak/91abbd1aba3c9b0d0ba8 to your computer and use it in GitHub Desktop.
create user in wordpress
$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