Answer the question
In order to leave comments, you need to log in
Why is a 500 error returned on registration?
Goodnight! I am making my registration form, but for some reason a 500 error is returned. Please advise what is wrong. PS. enters the function
add_action('wp_ajax_nopriv_registration', 'rs_new_user_registration');
function rs_new_user_registration(){
$userdata = [
'user_pass' => $_POST('password'),
'user_login' => $_POST('login'),
'user_email' => $_POST('email'),
'first_name' => $_POST('name'),
];
$user_id = wp_insert_user( $userdata );
// возврат
if( ! is_wp_error( $user_id ) ){
return true;
}
else {
return $user_id->get_error_message();
}
}
login: sadasd
name: nsadsajdnasdnjasd
email: [email protected]
country: adssad
password: qwe123456
password_repeat: qwe123456
type_user: Пациент
agree_rules: Cогласие на использование и обработку персональных данных
action: registration
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question