WordPress.org

Make WordPress Core

Ticket #23623: 23623.diff

File 23623.diff, 891 bytes (added by wonderboymusic, 15 months ago)
  • wp-includes/post.php

    diff --git wp-includes/post.php wp-includes/post.php
    index 4e7676b..5450735 100644
    function wp_insert_post($postarr, $wp_error = false) { 
    26552655                $previous_status = 'new'; 
    26562656        } 
    26572657 
     2658        if ( empty( $post_format ) ) 
     2659                $post_format = ''; 
     2660 
    26582661        $maybe_empty = ! $post_content && ! $post_title && ! $post_excerpt && post_type_supports( $post_type, 'editor' ) 
    2659                 && post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' ); 
     2662                && post_type_supports( $post_type, 'title' ) && post_type_supports( $post_type, 'excerpt' ) 
     2663                && ! in_array( $post_format, array( 'audio', 'video', 'quote', 'image', 'link' ) ); 
     2664 
    26602665        if ( apply_filters( 'wp_insert_post_empty_content', $maybe_empty, $postarr ) ) { 
    26612666                if ( $wp_error ) 
    26622667                        return new WP_Error( 'empty_content', __( 'Content, title, and excerpt are empty.' ) );