Make WordPress Core

Ticket #55459: 55459.diff

File 55459.diff, 3.2 KB (added by sabernhardt, 3 years ago)

option for supporting login_form_defaults filter in wp-login.php

  • src/wp-login.php

     
    526526 */
    527527$login_link_separator = apply_filters( 'login_link_separator', ' | ' );
    528528
     529// Assign filterable labels for form controls.
     530$defaults = array(
     531        'label_username' => __( 'Username or Email Address' ),
     532        'label_password' => __( 'Password' ),
     533        'label_remember' => __( 'Remember Me' ),
     534        'label_log_in'   => __( 'Log In' ),
     535);
     536
     537/** This filter is documented in wp-includes/general-template.php */
     538$labels = apply_filters( 'login_form_defaults', $defaults );
     539
    529540switch ( $action ) {
    530541
    531542        case 'confirm_admin_email':
     
    826837
    827838                <form name="lostpasswordform" id="lostpasswordform" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=lostpassword', 'login_post' ) ); ?>" method="post">
    828839                        <p>
    829                                 <label for="user_login"><?php _e( 'Username or Email Address' ); ?></label>
     840                                <label for="user_login"><?php echo esc_html( $labels['label_username'] ); ?></label>
    830841                                <input type="text" name="user_login" id="user_login" class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" autocomplete="username" />
    831842                        </p>
    832843                        <?php
     
    13961407
    13971408                <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post">
    13981409                        <p>
    1399                                 <label for="user_login"><?php _e( 'Username or Email Address' ); ?></label>
     1410                                <label for="user_login"><?php echo esc_html( $labels['label_username'] ); ?></label>
    14001411                                <input type="text" name="log" id="user_login"<?php echo $aria_describedby_error; ?> class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" autocapitalize="off" autocomplete="username" />
    14011412                        </p>
    14021413
    14031414                        <div class="user-pass-wrap">
    1404                                 <label for="user_pass"><?php _e( 'Password' ); ?></label>
     1415                                <label for="user_pass"><?php echo esc_html( $labels['label_password'] ); ?></label>
    14051416                                <div class="wp-pwd">
    14061417                                        <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby_error; ?> class="input password-input" value="" size="20" autocomplete="current-password" />
    14071418                                        <button type="button" class="button button-secondary wp-hide-pw hide-if-no-js" data-toggle="0" aria-label="<?php esc_attr_e( 'Show password' ); ?>">
     
    14191430                        do_action( 'login_form' );
    14201431
    14211432                        ?>
    1422                         <p class="forgetmenot"><input name="rememberme" type="checkbox" id="rememberme" value="forever" <?php checked( $rememberme ); ?> /> <label for="rememberme"><?php esc_html_e( 'Remember Me' ); ?></label></p>
     1433                        <p class="forgetmenot"><input name="rememberme" type="checkbox" id="rememberme" value="forever" <?php checked( $rememberme ); ?> /> <label for="rememberme"><?php echo esc_html( $labels['label_remember'] ); ?></label></p>
    14231434                        <p class="submit">
    1424                                 <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php esc_attr_e( 'Log In' ); ?>" />
     1435                                <input type="submit" name="wp-submit" id="wp-submit" class="button button-primary button-large" value="<?php echo esc_attr( $labels['label_log_in'] ); ?>" />
    14251436                                <?php
    14261437
    14271438                                if ( $interim_login ) {