WordPress.org

Make WordPress Core

Changeset 35609


Ignore:
Timestamp:
11/11/2015 03:23:10 PM (6 years ago)
Author:
afercia
Message:

Accessibility: Improve form labels and descriptions for the Tags meta box in the Edit Post screen.

Fixes #34627.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/meta-boxes.php

    r35139 r35609  
    436436    <div class="jaxtag">
    437437    <div class="nojs-tags hide-if-js">
    438     <p><?php echo $taxonomy->labels->add_or_remove_items; ?></p>
    439     <textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?>><?php echo str_replace( ',', $comma . ' ', $terms_to_edit ); // textarea_escaped by esc_attr() ?></textarea></div>
     438        <label for="tax-input-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_or_remove_items; ?></label>
     439        <p><textarea name="<?php echo "tax_input[$tax_name]"; ?>" rows="3" cols="20" class="the-tags" id="tax-input-<?php echo $tax_name; ?>" <?php disabled( ! $user_can_assign_terms ); ?> aria-describedby="new-tag-<?php echo $tax_name; ?>-desc"><?php echo str_replace( ',', $comma . ' ', $terms_to_edit ); // textarea_escaped by esc_attr() ?></textarea></p>
     440    </div>
    440441    <?php if ( $user_can_assign_terms ) : ?>
    441442    <div class="ajaxtag hide-if-no-js">
    442         <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $box['title']; ?></label>
    443         <p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" value="" />
     443        <label class="screen-reader-text" for="new-tag-<?php echo $tax_name; ?>"><?php echo $taxonomy->labels->add_new_item; ?></label>
     444        <p><input type="text" id="new-tag-<?php echo $tax_name; ?>" name="newtag[<?php echo $tax_name; ?>]" class="newtag form-input-tip" size="16" autocomplete="off" aria-describedby="new-tag-<?php echo $tax_name; ?>-desc" value="" />
    444445        <input type="button" class="button tagadd" value="<?php esc_attr_e('Add'); ?>" /></p>
    445446    </div>
    446     <p class="howto"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>
     447    <p class="howto" id="new-tag-<?php echo $tax_name; ?>-desc"><?php echo $taxonomy->labels->separate_items_with_commas; ?></p>
    447448    <?php endif; ?>
    448449    </div>
Note: See TracChangeset for help on using the changeset viewer.