Make WordPress Core


Ignore:
Timestamp:
02/23/2015 02:28:41 AM (10 years ago)
Author:
jeremyfelt
Message:

Provide proper label associations and descriptions throughout the network admin

  • Add labels previously missing for many inputs throughout the network admin screen.
  • Add proper aria-describedby attributes to provide better descriptions.
  • Wrap grouped inputs with fieldset elements.
  • Remove now unneeded title attributes when appropriate.

Props cfoellmann, afercia, rianrietveld.

Fixes #38406.

File:
1 edited

Legend:

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

    r30578 r31517  
    128128    <table class="form-table">
    129129        <tr class="form-field form-required">
    130             <th scope="row"><?php _e( 'Site Address' ) ?></th>
     130            <th scope="row"><label for="site-address"><?php _e( 'Site Address' ) ?></label></th>
    131131            <td>
    132132            <?php if ( is_subdomain_install() ) { ?>
    133                 <input name="blog[domain]" type="text" class="regular-text" id="site-address" title="<?php esc_attr_e( 'Domain' ) ?>"/><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', $current_site->domain ); ?></span>
     133                <input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" /><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', $current_site->domain ); ?></span>
    134134            <?php } else {
    135                 echo $current_site->domain . $current_site->path ?><input name="blog[domain]" class="regular-text" id="site-address" type="text" title="<?php esc_attr_e( 'Domain' ) ?>"/>
     135                echo $current_site->domain . $current_site->path ?><input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" />
    136136            <?php }
    137             echo '<p>' . __( 'Only lowercase letters (a-z) and numbers are allowed.' ) . '</p>';
     137            echo '<p id="site-address-desc">' . __( 'Only lowercase letters (a-z) and numbers are allowed.' ) . '</p>';
    138138            ?>
    139139            </td>
    140140        </tr>
    141141        <tr class="form-field form-required">
    142             <th scope="row"><?php _e( 'Site Title' ) ?></th>
    143             <td><input name="blog[title]" type="text" class="regular-text" id="site-title" title="<?php esc_attr_e( 'Title' ) ?>"/></td>
     142            <th scope="row"><label for="site-title"><?php _e( 'Site Title' ) ?></label></th>
     143            <td><input name="blog[title]" type="text" class="regular-text" id="site-title" /></td>
    144144        </tr>
    145145        <tr class="form-field form-required">
    146             <th scope="row"><?php _e( 'Admin Email' ) ?></th>
    147             <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" title="<?php esc_attr_e( 'Email' ) ?>"/></td>
     146            <th scope="row"><label for="admin-email"><?php _e( 'Admin Email' ) ?></label></td>
     147            <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>
    148148        </tr>
    149149        <tr class="form-field">
Note: See TracChangeset for help on using the changeset viewer.