Make WordPress Core


Ignore:
Timestamp:
09/30/2024 07:10:22 PM (6 months ago)
Author:
joedolson
Message:

Login and Registration: Add descriptive h1 on login screens.

Add an h1 heading with the existing login_header() text string on each view of the login screen. Mark the existing h1, used to wrap the WordPress logo, with role="presentation", to remove it from the headings hierarchy.

Props roytanck, joedolson, ryokuhi, sabernhardt, pamprn, nagpai, mukesh27.
Fixes #51786.

File:
1 edited

Legend:

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

    r59120 r59138  
    211211     */
    212212    do_action( 'login_header' );
    213 
     213    ?>
     214    <?php
     215    if ( 'confirm_admin_email' !== $action && ! empty( $title ) ) :
     216        ?>
     217        <h1 class="screen-reader-text"><?php echo $title; ?></h1>
     218        <?php
     219    endif;
    214220    ?>
    215221    <div id="login">
    216         <h1><a href="<?php echo esc_url( $login_header_url ); ?>"><?php echo $login_header_text; ?></a></h1>
     222        <h1 role="presentation" class="wp-login-logo"><a href="<?php echo esc_url( $login_header_url ); ?>"><?php echo $login_header_text; ?></a></h1>
    217223    <?php
    218224    /**
     
    421427        <?php } ?>
    422428    <?php } ?>
     429
    423430    <?php
    424431
Note: See TracChangeset for help on using the changeset viewer.