Make WordPress Core


Ignore:
Timestamp:
03/24/2015 04:28:56 PM (10 years ago)
Author:
johnbillion
Message:

Implement an aria-describedby attribute for login screen errors, and improve the "Forgot password?" anchor text.

Props aferica, rianrietveld
Fixes #31143

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-login.php

    r31417 r31871  
    890890        $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(wp_unslash($_POST['log'])) : '';
    891891    $rememberme = ! empty( $_POST['rememberme'] );
     892
     893    if ( ! empty( $errors->errors ) ) {
     894        $aria_describedby_error = ' aria-describedby="login_error"';
     895    } else {
     896        $aria_describedby_error = '';
     897    }
    892898?>
    893899
     
    895901    <p>
    896902        <label for="user_login"><?php _e('Username') ?><br />
    897         <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" /></label>
     903        <input type="text" name="log" id="user_login"<?php echo $aria_describedby_error; ?> class="input" value="<?php echo esc_attr( $user_login ); ?>" size="20" /></label>
    898904    </p>
    899905    <p>
    900906        <label for="user_pass"><?php _e('Password') ?><br />
    901         <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label>
     907        <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby_error; ?> class="input" value="" size="20" /></label>
    902908    </p>
    903909    <?php
Note: See TracChangeset for help on using the changeset viewer.