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
This commit is contained in:
parent
be259a7a72
commit
682ac07750
@ -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
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user