WordPress.org

Make WordPress Core

Changeset 20194


Ignore:
Timestamp:
03/15/2012 05:17:56 PM (6 years ago)
Author:
nacin
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-posts-list-table.php

    r19853 r20194  
    998998        $post_formats = get_theme_support( 'post-formats' );
    999999        if ( isset( $post_formats[0] ) && is_array( $post_formats[0] ) ) :
    1000             $all_post_formats = get_post_format_strings(); ?>
     1000            $all_post_formats = get_post_format_strings();
     1001            unset( $all_post_formats['standard'] ); ?>
    10011002            <div class="inline-edit-group">
    10021003                <label class="alignleft" for="post_format">
     
    10071008                <?php endif; ?>
    10081009                    <option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option>
    1009                 <?php foreach ( $all_post_formats as $slug => $format ):
    1010                     if ( $slug != 'standard' ) : ?>
    1011                     <option value="<?php echo esc_attr( $slug ); ?>"<?php if ( ! in_array( $slug, $post_formats[0] ) ) echo ' class="unsupported"'; ?>><?php echo esc_html( $format ); ?></option>
    1012                     <?php endif;
    1013                 endforeach; ?>
     1010                <?php foreach ( $all_post_formats as $slug => $format ) :
     1011                    $supported = in_array( $slug, $post_formats[0] );
     1012                    if ( $bulk && ! $supported )
     1013                        continue;
     1014                    ?>
     1015                    <option value="<?php echo esc_attr( $slug ); ?>"<?php if ( ! $supported ) echo ' class="unsupported"'; ?>><?php echo esc_html( $format ); ?></option>
     1016                <?php endforeach; ?>
    10141017                </select></label>
    10151018            </div>
Note: See TracChangeset for help on using the changeset viewer.