WordPress.org

Make WordPress Core

Changeset 42793


Ignore:
Timestamp:
03/07/2018 07:40:58 PM (3 years ago)
Author:
afercia
Message:

Accessibility: Networks and Sites: mark the New Site required form fields as required.

Also, adds an aria-describedby attribute to associate the Admin Email field with its description.

Props dipesh.kakadiya, jackreichert, rianrietveld.
Fixes #37331.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/network/site-new.php

    r42606 r42793  
    213213}
    214214?>
     215<p><?php
     216printf(
     217    /* translators: %s: asterisk to mark required form fields. */
     218    __( 'Required fields are marked %s' ),
     219    '<span class="required">*</span>'
     220);
     221?></p>
    215222<form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
    216223<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ); ?>
    217224    <table class="form-table">
    218225        <tr class="form-field form-required">
    219             <th scope="row"><label for="site-address"><?php _e( 'Site Address (URL)' ); ?></label></th>
     226            <th scope="row"><label for="site-address"><?php _e( 'Site Address (URL)' ); ?> <span class="required">*</span></label></th>
    220227            <td>
    221228            <?php if ( is_subdomain_install() ) { ?>
    222                 <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off"/><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
     229                <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required /><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
    223230            <?php
    224231} else {
    225232    echo get_network()->domain . get_network()->path
    226233    ?>
    227                 <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc"  autocapitalize="none" autocorrect="off" />
     234                <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off" required />
    228235<?php
    229236}
     
    233240        </tr>
    234241        <tr class="form-field form-required">
    235             <th scope="row"><label for="site-title"><?php _e( 'Site Title' ); ?></label></th>
    236             <td><input name="blog[title]" type="text" class="regular-text" id="site-title" /></td>
     242            <th scope="row"><label for="site-title"><?php _e( 'Site Title' ); ?> <span class="required">*</span></label></th>
     243            <td><input name="blog[title]" type="text" class="regular-text" id="site-title" required /></td>
    237244        </tr>
    238245        <?php
     
    268275        <?php endif; // Languages. ?>
    269276        <tr class="form-field form-required">
    270             <th scope="row"><label for="admin-email"><?php _e( 'Admin Email' ); ?></label></th>
    271             <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" /></td>
     277            <th scope="row"><label for="admin-email"><?php _e( 'Admin Email' ); ?> <span class="required">*</span></label></th>
     278            <td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" aria-describedby="site-admin-email" required /></td>
    272279        </tr>
    273280        <tr class="form-field">
    274             <td colspan="2"><?php _e( 'A new user will be created if the above email address is not in the database.' ); ?><br /><?php _e( 'The username and a link to set the password will be mailed to this email address.' ); ?></td>
     281            <td colspan="2"><p id="site-admin-email"><?php _e( 'A new user will be created if the above email address is not in the database.' ); ?><br /><?php _e( 'The username and a link to set the password will be mailed to this email address.' ); ?></p></td>
    275282        </tr>
    276283    </table>
Note: See TracChangeset for help on using the changeset viewer.