From acd961d4f8dd1d13b6b7f2294ae8f5588be34f2e Mon Sep 17 00:00:00 2001 From: Mark Jaquith 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: https://develop.svn.wordpress.org/trunk@17062 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 = '';