Don't clear saved username in wp_attempt_focus. props JohnPBloch, wojtek.szkutnik. fixes #14031.

git-svn-id: https://develop.svn.wordpress.org/trunk@16870 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2010-12-11 04:59:49 +00:00
parent 82c7adaec6
commit 3ce701f9f3
1 changed files with 7 additions and 1 deletions

View File

@ -671,11 +671,17 @@ function wp_attempt_focus(){
setTimeout( function(){ try{
<?php if ( $user_login || $interim_login ) { ?>
d = document.getElementById('user_pass');
d.value = '';
<?php } else { ?>
d = document.getElementById('user_login');
<?php } ?>
<?php if ( 'invalid_username' == $errors->get_error_code() ) { ?>
if( d.value != '' )
d.value = '';
<?php
}
}?>
d.focus();
d.select();
} catch(e){}
}, 200);
}