Opened 10 years ago
Closed 10 years ago
#28691 closed defect (bug) (fixed)
wp-login.php wp_attempt_focus does not run on logout
Reported by: | MikeLittle | Owned by: | SergeyBiryukov |
---|---|---|---|
Milestone: | 4.0 | Priority: | normal |
Severity: | normal | Version: | 4.0 |
Component: | Login and Registration | Keywords: | has-patch |
Focuses: | Cc: |
Description
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.
Attachments (1)
Change History (3)
Note: See
TracTickets for help on using
tickets.
Patch to fix the issue.