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/page.php

    r7426 r7438  
    124124
    125125                if ( isset($_POST['save']) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    126                         $location = "page.php?action=edit&post=$page_ID";
     126                        if ( $_POST['_wp_original_http_referer'] && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false )
     127                                $location = add_query_arg( '_wp_original_http_referer', urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ), "page.php?action=edit&post=$page_ID&message=1" );
     128                        else
     129                                $location = "page.php?action=edit&post=$page_ID";
    127130                } elseif ($_POST['addmeta']) {
    128131                        $location = add_query_arg( 'message', 2, wp_get_referer() );
Note: See TracChangeset for help on using the changeset viewer.