"Go back" link for admin-initiated post/page edits. e.g. do a search, edit a post, click the link to go back to the search.

git-svn-id: https://develop.svn.wordpress.org/trunk@7438 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith
2008-03-21 03:31:12 +00:00
parent f99aa53f68
commit 29475bd4be
5 changed files with 34 additions and 22 deletions

View File

@@ -136,7 +136,10 @@ case 'editpost':
$referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
if ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
$location = "post.php?action=edit&post=$post_ID";
if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false )
$location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "post.php?action=edit&post=$post_ID&message=1" );
else
$location = "post.php?action=edit&post=$post_ID";
} elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
$location = add_query_arg( 'message', 2, wp_get_referer() );
$location = explode('#', $location);