📅  最后修改于: 2022-03-11 14:53:38.454000             🧑  作者: Mango
$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
}