From ebe758b5c6be60498d9a29a04454ec09cad74a47 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Wed, 6 Mar 2013 23:55:54 +0000 Subject: [PATCH] Use auto-draft rather than post_ID = 0 to detect whether we are adding a new post. see #23665. git-svn-id: http://core.svn.wordpress.org/trunk@23631 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-form-advanced.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-admin/edit-form-advanced.php b/wp-admin/edit-form-advanced.php index b96190fe6e..744f3b2978 100644 --- a/wp-admin/edit-form-advanced.php +++ b/wp-admin/edit-form-advanced.php @@ -168,8 +168,8 @@ if ( post_type_supports($post_type, 'author') ) { add_meta_box('authordiv', __('Author'), 'post_author_meta_box', null, 'normal', 'core'); } -// TODO review this count() - why do we need to add it? -if ( post_type_supports($post_type, 'revisions') && 0 < $post_ID && count ( wp_get_post_revisions( $post_ID ) ) > 1 ) +// We should aim to show the revisions metabox only when there are revisions. +if ( post_type_supports($post_type, 'revisions') && 'auto-draft' != $post->post_status && count( wp_get_post_revisions( $post_ID ) ) > 1 ) add_meta_box('revisionsdiv', __('Revisions'), 'post_revisions_meta_box', null, 'normal', 'core'); do_action('add_meta_boxes', $post_type, $post);