Я пытался вызвать переменную $ hetest, но она всегда возвращает значение true, однако я добавляю false в качестве параметра при вызове функции
//function which i call in javascript file
create_new_user_send_sms(user_Mobile_Number,false)
.fail(error => console.error(error))
.done(response => {})
//the ajax call of the function i created
function create_new_user_send_sms(mobile_number,hestatus){
return jQuery.ajax({
type : "POST",
url: ajax_object.ajax_url,
data: {
action : 'create_user_send_sms',
mobile_number : mobile_number,
auto_Login_status : "true",
he : hestatus,
},
success: function (data) {
},
error : function(error){
console.log("error:" + error);
}
});
}
//the code in the php function create_user_send_sms
$mobile_number = $_POST['mobile_number'];
$auto_Login_status = $_POST['auto_Login_status'];
$hetest = $_POST['he'];
$password = wp_generate_password( 4, false, false );