Make WordPress Core

Ticket #15882: 15882.2.diff

File 15882.2.diff, 1.3 KB (added by nacin, 14 years ago)
  • wp-admin/includes/meta-boxes.php

     
    247247        if ( is_array( $post_formats[0] ) ) :
    248248                $post_format = get_post_format( $post->ID );
    249249                if ( !$post_format )
    250                         $post_format = get_option('default_post_format', '0');
     250                        $post_format = '0';
    251251                $post_format_display = get_post_format_string( $post_format );
    252252                // Add in the current one if it isn't there yet, in case the current theme doesn't support it
    253253                if ( $post_format && !in_array( $post_format, $post_formats[0] ) )
  • wp-admin/includes/post.php

     
    391391                        wp_delete_post( $delete, true ); // Force delete
    392392                $post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) );
    393393                $post = get_post( $post_id );
     394                if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) )
     395                        set_post_format( $post, get_option( 'default_post_format' ) );
    394396        } else {
    395397                $post->ID = 0;
    396398                $post->post_author = '';