Make WordPress Core


Ignore:
Timestamp:
03/21/2008 03:31:12 AM (18 years ago)
Author:
markjaquith
Message:

"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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/post.php

    r7426 r7438  
    137137
    138138                if ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    139                         $location = "post.php?action=edit&post=$post_ID";
     139                        if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false )
     140                                $location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "post.php?action=edit&post=$post_ID&message=1" );
     141                        else
     142                                $location = "post.php?action=edit&post=$post_ID";
    140143                } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
    141144                        $location = add_query_arg( 'message', 2, wp_get_referer() );
Note: See TracChangeset for help on using the changeset viewer.