Use get_post_format() instead of assuming we already have it.

* Fixes an issue where image posts without a title could not be deleted

fixes #23887. see #24046. props WraithKenny, SergeyBiryukov.

git-svn-id: http://core.svn.wordpress.org/trunk@24015 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith 2013-04-17 17:49:44 +00:00
parent 7dd27586af
commit 7c1ef6c33a
1 changed files with 1 additions and 4 deletions

View File

@ -2655,12 +2655,9 @@ function wp_insert_post($postarr, $wp_error = false) {
$previous_status = 'new';
}
if ( empty( $post_format ) )
$post_format = '';
$maybe_empty = ! $post_content && ! $post_title && ! $post_excerpt && post_type_supports( $post_type, 'editor' )
&& post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' )
&& ! in_array( $post_format, array( 'audio', 'video', 'quote', 'image' ) );
&& ! in_array( get_post_format( $post_ID ), array( 'audio', 'video', 'quote', 'image' ) );
if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) {
if ( $wp_error )