Make WordPress Core

Ticket #18713: 18713.2.diff

File 18713.2.diff, 873 bytes (added by nacin, 14 years ago)
  • wp-includes/post.php

     
    24392439                $previous_status = 'new';
    24402440        }
    24412441
    2442         if ( ('' == $post_content) && ('' == $post_title) && ('' == $post_excerpt) && ('attachment' != $post_type) ) {
     2442        $empty_content = ! $post_content && ! $post_title && ! $post_excerpt && post_type_supports( $post_type, 'editor' )
     2443                && post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' );
     2444        if ( apply_filters( 'wp_insert_post_empty_content', $empty_content, $postarr ) ) {
    24432445                if ( $wp_error )
    2444                         return new WP_Error('empty_content', __('Content, title, and excerpt are empty.'));
     2446                        return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );
    24452447                else
    24462448                        return 0;
    24472449        }