I\'m trying to build a simple wordpress password change script of my own (well, based on a plugin really) - the password is successfully changed - but it logs me out after t
Actually this:
if(!is_wp_error($update))
{
wp_cache_delete($user_ID,'users');
wp_cache_delete($user->user_login,'userlogins');
wp_logout();
if (wp_signon(array('user_login'=>$user->user_login,'user_password'=>$_POST['admin_pass1']),false)):
wp_redirect(admin_url());
endif;
ob_start();
}
means that if there are no errors the following functions will be executed. One of this functions is wp_logout() which will be always called if the conditional block is executed.
If it's not what you want, then you want to consider replacing:
if(!is_wp_error($update))
with:
if(is_wp_error($update))