From 9e63ebda787d8609c01d5fb5cdb5d56b4a6f1aaa Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Sun, 19 Jun 2005 23:44:22 +0000 Subject: [PATCH] =?UTF-8?q?Return=20post=5FID=20from=20write=5Fpost()=20an?= =?UTF-8?q?d=20pass=20it=20along=20when=20doing=20a=20save=20and=20continu?= =?UTF-8?q?e=20redirect.=20=20Props:=20C=C5=BDedric?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://develop.svn.wordpress.org/trunk@2654 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/admin-functions.php | 2 ++ wp-admin/post.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 43bc15b133..5d3aea7e57 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -52,6 +52,8 @@ function write_post() { // Create the post. $post_ID = wp_insert_post($_POST); add_meta($post_ID); + + return $post_ID; } // Update an existing post with values provided in $_POST. diff --git a/wp-admin/post.php b/wp-admin/post.php index 5771bcaa58..a24230da3c 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -30,7 +30,7 @@ $editing = true; switch($action) { case 'post': - write_post(); + $post_ID = write_post(); // Redirect. if (!empty($_POST['mode'])) {