Make WordPress Core

Changeset 17062


Ignore:
Timestamp:
12/19/2010 07:22:31 PM (14 years ago)
Author:
markjaquith
Message:

Only set default post format on new posts – not old ones. props nacin. fixes #15882

Location:
trunk/wp-admin/includes
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/meta-boxes.php

    r17056 r17062  
    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
  • trunk/wp-admin/includes/post.php

    r16901 r17062  
    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;
Note: See TracChangeset for help on using the changeset viewer.