[wp-trac] [WordPress Trac] #28691: wp-login.php wp_attempt_focus does not run on logout
WordPress Trac
noreply at wordpress.org
Mon Jun 30 14:15:31 UTC 2014
#28691: wp-login.php wp_attempt_focus does not run on logout
------------------------------------+-----------------------------
Reporter: MikeLittle | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Login and Registration | Version: trunk
Severity: normal | Keywords:
Focuses: |
------------------------------------+-----------------------------
Whenever you visit wp-login.php the code runs the JavaScript function
wp_attempt_focus to move the focus to the login field. However if the
parameter loggedout=true is in the URI, the JavaScript function is not
called. Another action is required (tab or click) in order to login again.
The reason the code is not called is because of the following logic:
* The global variable {{{ $error }}}
is set up to hold any errors generated by the processing on the login
page.
* The code to output the call to wp_attempt_focus checks whether the
variable has been set.
* If the variable is set, it does not output the call to the JS function.
* However, there is a loop in the code line 176 that overwrites the global
$error variable
{{{
foreach ( $wp_error->get_error_messages($code) as $error )
}}}
* If I change that loop to use a different interim variable, the
Javascript is output and focus is set. Moreover, the correct message "You
are now logged out" is still displayed.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/28691>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list