WordPress.org

Make WordPress Core

Changeset 39247


Ignore:
Timestamp:
11/15/16 16:00:41 (10 months ago)
Author:
afercia
Message:

Accessibility: Improve the Post Attributes meta box fields labels.

With [38951] the support for custom page templates has been extended to all post
types. By making the visible meta box titles real labels, accessibility improves
for all users and form fields have meaningful labels.

Fixes #38790.

Location:
trunk/src/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/edit.css

    r38880 r39247  
    627627.ie8 #poststuff .inside #page_template { 
    628628    width: 250px; 
     629} 
     630 
     631.post-attributes-label-wrapper { 
     632    margin-bottom: 0.5em; 
     633} 
     634 
     635.post-attributes-label { 
     636    vertical-align: baseline; 
     637    font-weight: 600; 
    629638} 
    630639 
  • trunk/src/wp-admin/includes/meta-boxes.php

    r38951 r39247  
    814814        if ( ! empty($pages) ) : 
    815815?> 
    816 <p><strong><?php _e('Parent') ?></strong></p> 
    817 <label class="screen-reader-text" for="parent_id"><?php _e('Parent') ?></label> 
     816<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="parent_id"><?php _e( 'Parent' ); ?></label></p> 
    818817<?php echo $pages; ?> 
    819818<?php 
     
    824823        $template = ! empty( $post->page_template ) ? $post->page_template : false; 
    825824        ?> 
    826 <p><strong><?php _e('Template') ?></strong><?php 
     825<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="page_template"><?php _e( 'Template' ); ?></label><?php 
    827826    /** 
    828      * Fires immediately after the heading inside the 'Template' section 
     827     * Fires immediately after the label inside the 'Template' section 
    829828     * of the 'Page Attributes' meta box. 
    830829     * 
     
    836835    do_action( 'page_attributes_meta_box_template', $template, $post ); 
    837836?></p> 
    838 <label class="screen-reader-text" for="page_template"> 
    839     <?php 
    840     $post_type_object = get_post_type_object( $post->post_type ); 
    841     echo esc_html( $post_type_object->labels->attributes ); 
    842     ?> 
    843 </label> 
    844837<select name="page_template" id="page_template"> 
    845838<?php 
     
    860853<?php endif; ?> 
    861854<?php if ( post_type_supports( $post->post_type, 'page-attributes' ) ) : ?> 
    862 <p><strong><?php _e('Order') ?></strong></p> 
    863 <p><label class="screen-reader-text" for="menu_order"><?php _e('Order') ?></label><input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr($post->menu_order) ?>" /></p> 
     855<p class="post-attributes-label-wrapper"><label class="post-attributes-label" for="menu_order"><?php _e( 'Order' ); ?></label></p> 
     856<input name="menu_order" type="text" size="4" id="menu_order" value="<?php echo esc_attr( $post->menu_order ); ?>" /> 
    864857<?php if ( 'page' == $post->post_type && get_current_screen()->get_help_tabs() ) : ?> 
    865858<p><?php _e( 'Need help? Use the Help tab above the screen title.' ); ?></p> 
Note: See TracChangeset for help on using the changeset viewer.