mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-10 07:34:34 +00:00
Return post_ID from write_post() and pass it along when doing a save and continue redirect. Props: CŽedric
git-svn-id: https://develop.svn.wordpress.org/trunk@2654 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -30,7 +30,7 @@ $editing = true;
|
||||
switch($action) {
|
||||
case 'post':
|
||||
|
||||
write_post();
|
||||
$post_ID = write_post();
|
||||
|
||||
// Redirect.
|
||||
if (!empty($_POST['mode'])) {
|
||||
|
||||
Reference in New Issue
Block a user