Allow the content of no-title audio, video, quote, and image posts to be blanked.

props wonderboymusic. fixes #23623.

git-svn-id: http://core.svn.wordpress.org/trunk@23986 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Mark Jaquith 2013-04-14 01:43:01 +00:00
parent 21bb61466a
commit 259f4fdef4

View File

@ -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.' ) );