From 3e2b2f37b25f544db2538e5c5ea9949d91a40afe Mon Sep 17 00:00:00 2001 From: saxmatt Date: Mon, 10 May 2004 08:33:03 +0000 Subject: [PATCH] Some tricks that in some cases speed up perceived posting time. git-svn-id: http://svn.automattic.com/wordpress/trunk@1259 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/post.php | 57 +++++++++++++++++++++++------------------------ 1 file changed, 28 insertions(+), 29 deletions(-) diff --git a/wp-admin/post.php b/wp-admin/post.php index aa64fcc85..5654763bb 100644 --- a/wp-admin/post.php +++ b/wp-admin/post.php @@ -93,22 +93,6 @@ case 'post': $now_gmt = current_time('mysql', 1); } - if (!empty($_POST['mode'])) { - switch($_POST['mode']) { - case 'bookmarklet': - $location = 'bookmarklet.php?a=b'; - break; - case 'sidebar': - $location = 'sidebar.php?a=b'; - break; - default: - $location = 'post.php'; - break; - } - } else { - $location = 'post.php'; - } - // What to do based on which button they pressed if ('' != $_POST['saveasdraft']) $post_status = 'draft'; if ('' != $_POST['saveasprivate']) $post_status = 'private'; @@ -134,9 +118,26 @@ case 'post': $post_ID = $wpdb->get_var("SELECT ID FROM $tableposts ORDER BY ID DESC LIMIT 1"); + if (!empty($_POST['mode'])) { + switch($_POST['mode']) { + case 'bookmarklet': + $location = 'bookmarklet.php?a=b'; + break; + case 'sidebar': + $location = 'sidebar.php?a=b'; + break; + default: + $location = 'post.php'; + break; + } + } else { + $location = 'post.php'; + } if ('' != $_POST['advanced']) $location = "post.php?action=edit&post=$post_ID"; + header("Location: $location"); // Send user on their way while we keep working + // Insert categories // Check to make sure there is a category, if not just set it to some default @@ -161,9 +162,6 @@ case 'post': sleep($sleep_after_edit); } - - header("Location: $location"); - if ($post_status == 'publish') { if((get_settings('use_geo_positions')) && ($post_latf != null) && ($post_lonf != null)) { pingGeoUrl($post_ID); @@ -323,6 +321,17 @@ case 'editpost': $datemodif_gmt = ''; } + if ($_POST['save']) { + $location = $_SERVER['HTTP_REFERER']; + } elseif ($_POST['updatemeta']) { + $location = $_SERVER['HTTP_REFERER'] . '&message=2#postcustom'; + } elseif ($_POST['deletemeta']) { + $location = $_SERVER['HTTP_REFERER'] . '&message=3#postcustom'; + } else { + $location = 'post.php'; + } + header ('Location: ' . $location); // Send user on their way while we keep working + $now = current_time('mysql'); $now_gmt = current_time('mysql', 1); @@ -406,16 +415,6 @@ $now_gmt = current_time('mysql', 1); add_meta($post_ID); - if ($_POST['save']) { - $location = $_SERVER['HTTP_REFERER']; - } elseif ($_POST['updatemeta']) { - $location = $_SERVER['HTTP_REFERER'] . '&message=2#postcustom'; - } elseif ($_POST['deletemeta']) { - $location = $_SERVER['HTTP_REFERER'] . '&message=3#postcustom'; - } else { - $location = 'post.php'; - } - header ('Location: ' . $location); do_action('edit_post', $post_ID); exit(); break;