From 5d9dc8f2310e20e60f002fbd8bb8bc568b40e7b0 Mon Sep 17 00:00:00 2001 From: rboren Date: Tue, 14 Sep 2004 06:54:09 +0000 Subject: [PATCH] Save meta info to DB before doing the publish_post action. git-svn-id: http://svn.automattic.com/wordpress/trunk@1644 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/post.php | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/wp-admin/post.php b/wp-admin/post.php index 1e3b5f01ad..98394ac0ae 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -376,6 +376,20 @@ $now_gmt = current_time('mysql', 1); post_modified_gmt = '$now_gmt' WHERE ID = $post_ID "); + // Meta Stuff + if ($_POST['meta']) : + foreach ($_POST['meta'] as $key => $value) : + update_meta($key, $value['key'], $value['value']); + endforeach; + endif; + + if ($_POST['deletemeta']) : + foreach ($_POST['deletemeta'] as $key => $value) : + delete_meta($key); + endforeach; + endif; + + add_meta($post_ID); // Now it's category time! // First the old categories @@ -405,6 +419,7 @@ $now_gmt = current_time('mysql', 1); } // end if moving from draft/private to published if ($post_status == 'publish') { do_action('publish_post', $post_ID); + // Trackback time. $to_ping = trim($wpdb->get_var("SELECT to_ping FROM $wpdb->posts WHERE ID = $post_ID")); $pinged = trim($wpdb->get_var("SELECT pinged FROM $wpdb->posts WHERE ID = $post_ID")); @@ -426,21 +441,6 @@ $now_gmt = current_time('mysql', 1); } } // end if publish - // Meta Stuff - if ($_POST['meta']) : - foreach ($_POST['meta'] as $key => $value) : - update_meta($key, $value['key'], $value['value']); - endforeach; - endif; - - if ($_POST['deletemeta']) : - foreach ($_POST['deletemeta'] as $key => $value) : - delete_meta($key); - endforeach; - endif; - - add_meta($post_ID); - do_action('edit_post', $post_ID); exit(); break;