From 16efd6a7f3be5ab9917ada3f8f67a013b080c80f Mon Sep 17 00:00:00 2001 From: ryan 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: http://svn.automattic.com/wordpress/trunk@2654 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- 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'])) {