Ticket #18713: 18713.2.diff

File 18713.2.diff, 873 bytes (added by nacin, 18 months ago)
Line 
1Index: wp-includes/post.php
2===================================================================
3--- wp-includes/post.php        (revision 19277)
4+++ wp-includes/post.php        (working copy)
5@@ -2439,9 +2439,11 @@
6                $previous_status = 'new';
7        }
8 
9-       if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) && ('attachment' != $post_type) ) {
10+       $empty_content = ! $post_content && ! $post_title && ! $post_excerpt && post_type_supports( $post_type, 'editor' )
11+               && post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' );
12+       if ( apply_filters( 'wp_insert_post_empty_content', $empty_content, $postarr ) ) {
13                if ( $wp_error )
14-                       return new WP_Error('empty_content', __('Content, title, and excerpt are empty.'));
15+                       return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );
16                else
17                        return 0;
18        }