From 0ac7d034a69851f9cdfd754d53f86505fbd7d998 Mon Sep 17 00:00:00 2001 From: Mark Jaquith Date: Sun, 14 Apr 2013 01:43:01 +0000 Subject: [PATCH] Allow the content of no-title audio, video, quote, and image posts to be blanked. props wonderboymusic. fixes #23623. git-svn-id: https://develop.svn.wordpress.org/trunk@23986 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index 4e7676bdc5..a29e5b7082 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2655,8 +2655,13 @@ 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' ); + && post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' ) + && ! in_array( $post_format, array( 'audio', 'video', 'quote', 'image' ) ); + if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) { if ( $wp_error ) return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );