From ff064c5422e35fb090cb7adc037a3103e0b2b7cd Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Wed, 17 Apr 2013 17:49:44 +0000 Subject: [PATCH] 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: https://develop.svn.wordpress.org/trunk@24015 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index a29e5b7082..01f9e8cec3 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -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 )