Don't allow changing the post format from quick edit and bulk edit. These do not have sufficient context to set the post format.

Props kovshenin
fixes #23426


git-svn-id: https://develop.svn.wordpress.org/trunk@23742 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2013-03-18 17:24:24 +00:00
parent b16e4eaf58
commit 75dcc983d7
2 changed files with 0 additions and 37 deletions

View File

@ -1032,32 +1032,6 @@ class WP_Posts_List_Table extends WP_List_Table {
<?php endif; // 'post' && $can_publish && current_user_can( 'edit_others_cap' ) ?>
</div>
<?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();
unset( $all_post_formats['standard'] ); ?>
<div class="inline-edit-group">
<label class="alignleft" for="post_format">
<span class="title"><?php _ex( 'Format', 'post format' ); ?></span>
<select name="post_format">
<?php if ( $bulk ) : ?>
<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 ) :
$unsupported = ! in_array( $slug, $post_formats[0] );
if ( $bulk && $unsupported )
continue;
?>
<option value="<?php echo esc_attr( $slug ); ?>"<?php if ( $unsupported ) echo ' class="unsupported"'; ?>><?php echo esc_html( $format ); ?></option>
<?php endforeach; ?>
</select></label>
</div>
<?php endif; ?>
<?php endif; // post-formats ?>
</div></fieldset>
<?php

View File

@ -352,14 +352,6 @@ function bulk_edit_posts( $post_data = null ) {
}
}
if ( isset( $post_data['post_format'] ) ) {
if ( '0' == $post_data['post_format'] )
$post_data['post_format'] = false;
// don't change the post format if it's not supported or not '0' (standard)
elseif ( ! current_theme_supports( 'post-formats', $post_data['post_format'] ) )
unset( $post_data['post_format'] );
}
$updated = $skipped = $locked = array();
foreach ( $post_IDs as $post_ID ) {
$post_type_object = get_post_type_object( get_post_type( $post_ID ) );
@ -409,9 +401,6 @@ function bulk_edit_posts( $post_data = null ) {
else
unstick_post( $post_ID );
}
if ( isset( $post_data['post_format'] ) )
set_post_format( $post_ID, $post_data['post_format'] );
}
return array( 'updated' => $updated, 'skipped' => $skipped, 'locked' => $locked );