normally login and logout functionality works as I expected in my application however something goes wrong when users login and then the user decide to change his/her password after changing his password, the user will then tried to logout however their is a default logout page in wordpress says that “Are you sure to logout in [Your THEME NAME] ?” How can I disabled that default logout page or maybe redirect to my custom logout page ?
So I did try to have wp_logout_url(‘/custom_page_logout/’) because I did saw some solution they also did that however for me it still didn’t work.
So this is the code I use for changing the password of the user and staying him a logging In because usually when changing password the user is automatically logout
`
$new_password = $_POST[‘newpassword’];
$confirm_password = $_POST[‘confirmpassword’];
if ($new_password === $confirm_password) {
$current_user = wp_get_current_user();
$current_user_id = $current_user->ID;
$users_login = $current_user->user_email;
wp_set_password($new_password, $current_user_id);
$user_data = array(
'user_login' => $users_login,
'user_password' => $new_password,
'remember' => false
);
$result = wp_signon( $user_data );
`