Make WordPress Core

Changeset 57288


Ignore:
Timestamp:
01/16/2024 03:21:45 AM (3 months ago)
Author:
peterwilsoncc
Message:

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.

Location:
branches/6.4
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/6.4

  • branches/6.4/src/wp-login.php

    r56750 r57288  
    258258                $errors .= '</ul>';
    259259            } else {
    260                 $errors .= '<p>' . $error_message . '</p>';
     260                $errors .= '<p>' . $error_list[0] . '</p>';
    261261            }
    262262
     
    266266             * @since 2.1.0
    267267             *
    268              * @param string $errors Login error message.
     268             * @param string $errors Login error messages.
    269269             */
    270270            $errors = apply_filters( 'login_errors', $errors );
     271
    271272            wp_admin_notice(
    272273                $errors,
     
    288289             */
    289290            $messages = apply_filters( 'login_messages', $messages );
     291
    290292            wp_admin_notice(
    291293                $messages,
Note: See TracChangeset for help on using the changeset viewer.