From f78592cf01173d883ec0430822b85a3bfcb7ea9f Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 29 Aug 2007 17:24:42 +0000 Subject: [PATCH] Redirect back to post-new.php when doing a save and continue with empty post fields. fixes #4855 git-svn-id: http://svn.automattic.com/wordpress/trunk@5967 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 3 +++ wp-admin/post.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 989b41f16..ab70d0c5b 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -285,6 +285,9 @@ function wp_write_post() { // Create the post. $post_ID = wp_insert_post( $_POST ); + if ( empty($post_ID) ) + return 0; + add_meta( $post_ID ); // Reunite any orphaned attachments with their parent diff --git a/wp-admin/post.php b/wp-admin/post.php index 8f3574f27..f08368662 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -38,6 +38,9 @@ case 'post': if ( isset($_POST['save']) ) $location = "post.php?action=edit&post=$post_ID"; + if ( empty($post_ID) ) + $location = 'post-new.php'; + wp_redirect($location); exit(); break;