Only set default post format on new posts – not old ones. props nacin. fixes #15882
git-svn-id: https://develop.svn.wordpress.org/trunk@17062 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
99bd388ef3
commit
acd961d4f8
@ -247,7 +247,7 @@ function post_format_meta_box( $post, $box ) {
|
||||
if ( is_array( $post_formats[0] ) ) :
|
||||
$post_format = get_post_format( $post->ID );
|
||||
if ( !$post_format )
|
||||
$post_format = get_option('default_post_format', '0');
|
||||
$post_format = '0';
|
||||
$post_format_display = get_post_format_string( $post_format );
|
||||
// Add in the current one if it isn't there yet, in case the current theme doesn't support it
|
||||
if ( $post_format && !in_array( $post_format, $post_formats[0] ) )
|
||||
|
@ -391,6 +391,8 @@ function get_default_post_to_edit( $post_type = 'post', $create_in_db = false )
|
||||
wp_delete_post( $delete, true ); // Force delete
|
||||
$post_id = wp_insert_post( array( 'post_title' => __( 'Auto Draft' ), 'post_type' => $post_type, 'post_status' => 'auto-draft' ) );
|
||||
$post = get_post( $post_id );
|
||||
if ( current_theme_supports( 'post-formats' ) && post_type_supports( $post->post_type, 'post-formats' ) && get_option( 'default_post_format' ) )
|
||||
set_post_format( $post, get_option( 'default_post_format' ) );
|
||||
} else {
|
||||
$post->ID = 0;
|
||||
$post->post_author = '';
|
||||
|
Loading…
Reference in New Issue
Block a user