Make WordPress Core


Ignore:
Timestamp:
10/19/2011 05:48:07 PM (15 years ago)
Author:
duck_
Message:

Show the current post format in quick edit even if it's not supported. Props nacin, fixes #18083.

File:
1 edited

Legend:

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

    r19010 r19011  
    999999        <?php if ( post_type_supports( $screen->post_type, 'post-formats' ) && current_theme_supports( 'post-formats' ) ) :
    10001000                $post_formats = get_theme_support( 'post-formats' );
    1001                 if ( is_array( $post_formats[0] ) ) : ?>
     1001                if ( isset( $post_formats[0] ) && is_array( $post_formats[0] ) ) :
     1002                        $all_post_formats = get_post_format_strings(); ?>
    10021003                        <div class="inline-edit-group">
    10031004                                <label class="alignleft" for="post_format">
    10041005                                <span class="title"><?php _e( 'Post Format' ); ?></span>
    1005                                 <select name="post_format" id="post_format">
     1006                                <select name="post_format">
    10061007                                <?php if ( $bulk ) : ?>
    10071008                                        <option value="-1"><?php _e( '&mdash; No Change &mdash;' ); ?></option>
    10081009                                <?php endif; ?>
    10091010                                        <option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option>
    1010                                 <?php foreach ( $post_formats[0] as $format ): ?>
    1011                                         <option value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
    1012                                 <?php endforeach; ?>
     1011                                <?php foreach ( $all_post_formats as $slug => $format ):
     1012                                        if ( $slug != 'standard' ) : ?>
     1013                                        <option value="<?php echo esc_attr( $slug ); ?>"<?php if ( ! in_array( $slug, $post_formats[0] ) ) echo ' class="unsupported"'; ?>><?php echo esc_html( $format ); ?></option>
     1014                                        <?php endif;
     1015                                endforeach; ?>
    10131016                                </select></label>
    10141017                        </div>
Note: See TracChangeset for help on using the changeset viewer.