Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

wp create user programmatically

$result = wp_create_user('johndoe', 'passwordgoeshere', 'john.doe@example.com');
if(is_wp_error($result)){
  $error = $result->get_error_message();
  //handle error here
}else{
  $user = get_user_by('id', $result);
  //handle successful creation here
}
Source by usersinsights.com #
 
PREVIOUS NEXT
Tagged: #wp #create #user #programmatically
ADD COMMENT
Topic
Name
1+4 =