From 3469500927c350bc38b268138d656f7b00a2e9a0 Mon Sep 17 00:00:00 2001 From: markjaquith Date: Sun, 19 Dec 2010 19:22:31 +0000 Subject: [PATCH] =?UTF-8?q?Only=20set=20default=20post=20format=20on=20new?= =?UTF-8?q?=20posts=20=E2=80=93=20not=20old=20ones.=20props=20nacin.=20fix?= =?UTF-8?q?es=20#15882?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://svn.automattic.com/wordpress/trunk@17062 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/meta-boxes.php | 2 +- wp-admin/includes/post.php | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/meta-boxes.php b/wp-admin/includes/meta-boxes.php index 00069cd04a..96466b5743 100644 --- a/wp-admin/includes/meta-boxes.php +++ b/wp-admin/includes/meta-boxes.php @@ -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] ) ) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index ce6c8b3bd7..9cacef3cf8 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -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 = '';