More semantic markup for the post formats metabox.

Screen readers will now introduce the group of radio buttons.
Also brings the meta box to parity with Press This.

Props joedolson, afercia.
Fixes #26160.


Built from https://develop.svn.wordpress.org/trunk@32720


git-svn-id: http://core.svn.wordpress.org/trunk@32690 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Konstantin Obenland 2015-06-10 09:09:25 +00:00
parent 0e76a2c570
commit ce16fd8dca
3 changed files with 9 additions and 6 deletions

View File

@ -790,7 +790,7 @@ class WP_Press_This {
?> ?>
<div id="post-formats-select"> <div id="post-formats-select">
<fieldset><legend class="screen-reader-text"><?php _e( 'Post formats' ); ?></legend> <fieldset><legend class="screen-reader-text"><?php _e( 'Post Formats' ); ?></legend>
<input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> />
<label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label>
<?php <?php

View File

@ -370,10 +370,13 @@ function post_format_meta_box( $post, $box ) {
$post_formats[0][] = $post_format; $post_formats[0][] = $post_format;
?> ?>
<div id="post-formats-select"> <div id="post-formats-select">
<fieldset>
<legend class="screen-reader-text"><?php _e( 'Post Formats' ); ?></legend>
<input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label> <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php echo get_post_format_string( 'standard' ); ?></label>
<?php foreach ( $post_formats[0] as $format ) : ?> <?php foreach ( $post_formats[0] as $format ) : ?>
<br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label> <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
<?php endforeach; ?><br /> <?php endforeach; ?>
</fieldset>
</div> </div>
<?php endif; endif; <?php endif; endif;
} }

View File

@ -4,7 +4,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '4.3-alpha-32719'; $wp_version = '4.3-alpha-32720';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.