From 6d01caf9f9145862474e29ca4b070e83b1790c7c Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Tue, 16 Jan 2024 03:23:16 +0000 Subject: [PATCH] Login and Registration: Use correct variable to display a single error message. When the `wp_login_errors` filter is used to add an error message followed by an instructional message, the former was not displayed and the latter was errouneously displayed twice above the login form. This commit ensures that the error message is displayed as expected. Follow-up to [56654]. Reviewed by jorbin. Merges [57142] to the 6.4 branch. Props mapumba, SergeyBiryukov. Fixes #59983. Built from https://develop.svn.wordpress.org/branches/6.4@57288 git-svn-id: http://core.svn.wordpress.org/branches/6.4@56794 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/version.php | 2 +- wp-login.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/wp-includes/version.php b/wp-includes/version.php index af9015eb74..aafdf61986 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4.3-alpha-57214'; +$wp_version = '6.4.3-alpha-57288'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-login.php b/wp-login.php index 2ed484a780..0641cd52e6 100644 --- a/wp-login.php +++ b/wp-login.php @@ -257,7 +257,7 @@ function login_header( $title = 'Log In', $message = '', $wp_error = null ) { $errors .= ''; } else { - $errors .= '

' . $error_message . '

'; + $errors .= '

' . $error_list[0] . '

'; } /** @@ -265,9 +265,10 @@ function login_header( $title = 'Log In', $message = '', $wp_error = null ) { * * @since 2.1.0 * - * @param string $errors Login error message. + * @param string $errors Login error messages. */ $errors = apply_filters( 'login_errors', $errors ); + wp_admin_notice( $errors, array( @@ -287,6 +288,7 @@ function login_header( $title = 'Log In', $message = '', $wp_error = null ) { * @param string $messages Login messages. */ $messages = apply_filters( 'login_messages', $messages ); + wp_admin_notice( $messages, array(