From 3ed5168fbef4491c41df269c6de3bdab5b9b1450 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 14 May 2010 18:30:43 +0000 Subject: [PATCH] Don't allow previewing auto-draft. Props duck_. fixes #12859 git-svn-id: https://develop.svn.wordpress.org/trunk@14643 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/includes/post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index ae12f44404..a7c07aae4b 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1283,7 +1283,8 @@ function wp_create_post_autosave( $post_id ) { function post_preview() { $post_ID = (int) $_POST['post_ID']; - if ( $post_ID < 1 ) + $status = get_post_status( $post_ID ); + if ( 'auto-draft' == $status ) wp_die( __('Preview not available. Please save as a draft first.') ); if ( isset($_POST['catslist']) )