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
This commit is contained in:
parent
0cb5968afc
commit
f78592cf01
|
@ -285,6 +285,9 @@ function wp_write_post() {
|
||||||
// Create the post.
|
// Create the post.
|
||||||
$post_ID = wp_insert_post( $_POST );
|
$post_ID = wp_insert_post( $_POST );
|
||||||
|
|
||||||
|
if ( empty($post_ID) )
|
||||||
|
return 0;
|
||||||
|
|
||||||
add_meta( $post_ID );
|
add_meta( $post_ID );
|
||||||
|
|
||||||
// Reunite any orphaned attachments with their parent
|
// Reunite any orphaned attachments with their parent
|
||||||
|
|
|
@ -38,6 +38,9 @@ case 'post':
|
||||||
if ( isset($_POST['save']) )
|
if ( isset($_POST['save']) )
|
||||||
$location = "post.php?action=edit&post=$post_ID";
|
$location = "post.php?action=edit&post=$post_ID";
|
||||||
|
|
||||||
|
if ( empty($post_ID) )
|
||||||
|
$location = 'post-new.php';
|
||||||
|
|
||||||
wp_redirect($location);
|
wp_redirect($location);
|
||||||
exit();
|
exit();
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue