Make WordPress Core


Ignore:
Timestamp:
02/23/2015 02:28:41 AM (11 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-info.php

    r31156 r31517  
    125125    <table class="form-table">
    126126        <tr class="form-field form-required">
    127             <th scope="row"><?php _e( 'Domain' ) ?></th>
    128127            <?php if ( $is_main_site ) { ?>
     128                <th scope="row"><?php _e( 'Domain' ) ?></th>
    129129                <td><code><?php echo $parsed['scheme'] . '://' . esc_attr( $details->domain ) ?></code></td>
    130130            <?php } else { ?>
     131                <th scope="row"><label for="domain"><?php _e( 'Domain' ) ?></label></th>
    131132                <td><?php echo $parsed['scheme'] . '://'; ?><input name="blog[domain]" type="text" id="domain" value="<?php echo esc_attr( $details->domain ) ?>" /></td>
    132133            <?php } ?>
    133134        </tr>
    134135        <tr class="form-field form-required">
     136            <?php if ( $is_main_site ) { ?>
    135137            <th scope="row"><?php _e( 'Path' ) ?></th>
    136             <?php if ( $is_main_site ) { ?>
    137138            <td><code><?php echo esc_attr( $details->path ) ?></code></td>
    138139            <?php
     
    140141                switch_to_blog( $id );
    141142            ?>
     143            <th scope="row"><label for="path"><?php _e( 'Path' ) ?></label></th>
    142144            <td>
    143145                <input name="blog[path]" type="text" id="path" value="<?php echo esc_attr( $details->path ) ?>" /><br />
    144                 <label><input type="checkbox" name="update_home_url" value="update" <?php if ( get_option( 'siteurl' ) == untrailingslashit( get_blogaddress_by_id ($id ) ) || get_option( 'home' ) == untrailingslashit( get_blogaddress_by_id( $id ) ) ) echo 'checked="checked"'; ?> /> <?php _e( 'Update <code>siteurl</code> and <code>home</code> as well.' ); ?></label>
     146                <input type="checkbox" name="update_home_url" id="update_home_url" value="update" <?php if ( get_option( 'siteurl' ) == untrailingslashit( get_blogaddress_by_id ($id ) ) || get_option( 'home' ) == untrailingslashit( get_blogaddress_by_id( $id ) ) ) echo 'checked="checked"'; ?> /> <label for="update_home_url"><?php _e( 'Update <code>siteurl</code> and <code>home</code> as well.' ); ?></label>
    145147            </td>
    146148            <?php
     
    149151        </tr>
    150152        <tr class="form-field">
    151             <th scope="row"><?php _ex( 'Registered', 'site' ) ?></th>
     153            <th scope="row"><label for="blog_registered"><?php _ex( 'Registered', 'site' ) ?></label></th>
    152154            <td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr( $details->registered ) ?>" /></td>
    153155        </tr>
    154156        <tr class="form-field">
    155             <th scope="row"><?php _e( 'Last Updated' ); ?></th>
     157            <th scope="row"><label for="blog_last_updated"><?php _e( 'Last Updated' ); ?></label></th>
    156158            <td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ) ?>" /></td>
    157159        </tr>
     
    168170            <th scope="row"><?php _e( 'Attributes' ); ?></th>
    169171            <td>
     172            <fieldset>
     173            <legend class="screen-reader-text"><?php _e( 'Set site attributes' ) ?></legend>
    170174            <?php foreach ( $attribute_fields as $field_key => $field_label ) : ?>
    171175                <label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); disabled( ! in_array( $details->$field_key, array( 0, 1 ) ) ); ?> />
    172176                <?php echo $field_label; ?></label><br/>
    173177            <?php endforeach; ?>
     178            <fieldset>
    174179            </td>
    175180        </tr>
Note: See TracChangeset for help on using the changeset viewer.