From 682ac077508a1ba182ad0e1f3f9a398ec760d510 Mon Sep 17 00:00:00 2001 From: Ryan Boren 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: https://develop.svn.wordpress.org/trunk@5967 602fd350-edb4-49c9-b593-d223f7449a82 --- 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 989b41f162..ab70d0c5ba 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 8f3574f278..f083686624 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;