Show the current post format in quick edit even if it's not supported. Props nacin, fixes #18083.
git-svn-id: http://svn.automattic.com/wordpress/trunk@19011 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
aa64ec5d1d
commit
16daac44ec
|
@ -998,18 +998,21 @@ 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 ( is_array( $post_formats[0] ) ) : ?>
|
||||
if ( isset( $post_formats[0] ) && is_array( $post_formats[0] ) ) :
|
||||
$all_post_formats = get_post_format_strings(); ?>
|
||||
<div class="inline-edit-group">
|
||||
<label class="alignleft" for="post_format">
|
||||
<span class="title"><?php _e( 'Post Format' ); ?></span>
|
||||
<select name="post_format" id="post_format">
|
||||
<select name="post_format">
|
||||
<?php if ( $bulk ) : ?>
|
||||
<option value="-1"><?php _e( '— No Change —' ); ?></option>
|
||||
<?php endif; ?>
|
||||
<option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option>
|
||||
<?php foreach ( $post_formats[0] as $format ): ?>
|
||||
<option value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option>
|
||||
<?php endforeach; ?>
|
||||
<?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; ?>
|
||||
</select></label>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -151,6 +151,14 @@ inlineEditPost = {
|
|||
$('label.inline-edit-author', editRow).hide();
|
||||
}
|
||||
|
||||
// hide unsupported formats, but leave the current format alone
|
||||
var cur_format = $('.post_format', rowData).text();
|
||||
$('option.unsupported', editRow).each(function() {
|
||||
var $this = $(this);
|
||||
if ( $this.val() != cur_format )
|
||||
$this.remove();
|
||||
});
|
||||
|
||||
for ( var f = 0; f < fields.length; f++ ) {
|
||||
$(':input[name="' + fields[f] + '"]', editRow).val( $('.'+fields[f], rowData).text() );
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue