Hide unsupported post formats from bulk edit. fixes #20245.

git-svn-id: http://svn.automattic.com/wordpress/trunk@20194 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
nacin 2012-03-15 17:17:56 +00:00
parent 962fae26f4
commit df4ef64baf

View File

@ -997,7 +997,8 @@ class WP_Posts_List_Table extends WP_List_Table {
<?php if ( post_type_supports( $screen->post_type, 'post-formats' ) && current_theme_supports( 'post-formats' ) ) :
$post_formats = get_theme_support( 'post-formats' );
if ( isset( $post_formats[0] ) && is_array( $post_formats[0] ) ) :
$all_post_formats = get_post_format_strings(); ?>
$all_post_formats = get_post_format_strings();
unset( $all_post_formats['standard'] ); ?>
<div class="inline-edit-group">
<label class="alignleft" for="post_format">
<span class="title"><?php _e( 'Post Format' ); ?></span>
@ -1006,11 +1007,13 @@ class WP_Posts_List_Table extends WP_List_Table {
<option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
<?php endif; ?>
<option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option>
<?php foreach ( $all_post_formats as $slug => $format ):
if ( $slug != 'standard' ) : ?>
<option value="<?php echo esc_attr( $slug ); ?>"<?php if ( ! in_array( $slug, $post_formats[0] ) ) echo ' class="unsupported"'; ?>><?php echo esc_html( $format ); ?></option>
<?php endif;
endforeach; ?>
<?php foreach ( $all_post_formats as $slug => $format ) :
$supported = in_array( $slug, $post_formats[0] );
if ( $bulk && ! $supported )
continue;
?>
<option value="<?php echo esc_attr( $slug ); ?>"<?php if ( ! $supported ) echo ' class="unsupported"'; ?>><?php echo esc_html( $format ); ?></option>
<?php endforeach; ?>
</select></label>
</div>
<?php endif; ?>