Make WordPress Core

Changeset 7116


Ignore:
Timestamp:
03/01/2008 12:16:55 AM (19 years ago)
Author:
ryan
Message:

Change save page redirects. see #6024

File:
1 edited

Legend:

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

    r7103 r7116  
    9696
    9797        $page_ID = edit_post();
     98        $page = get_post($page_ID);
    9899
    99100        if ( 'post' == $_POST['originalaction'] ) {
    … …  
    122123                $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
    123124
    124                 if ($_POST['addmeta']) {
     125                if ( isset($_POST['save']) && ( 'draft' == $page->post_status || 'pending' == $page->post_status ) ) {
     126                        $location = "page.php?action=edit&post=$page_ID";
     127                } elseif ( isset($_POST['save']) && (empty($referredby) || $referredby == $referer) ) {
     128                        $location = "page.php?action=edit&post=$page_ID";
     129                } elseif ($_POST['addmeta']) {
    125130                        $location = add_query_arg( 'message', 2, wp_get_referer() );
    126131                        $location = explode('#', $location);
    … …  
    136141                        if ( false !== strpos($location, 'edit-pages.php') )
    137142                                $location = add_query_arg('posted', $page_ID, $location);
     143                } elseif ( isset($_POST['publish']) ) {
     144                        $location = "page-new.php?posted=$page_ID";
    138145                } elseif ($action == 'editattachment') {
    139146                        $location = 'attachments.php';
Note: See TracChangeset for help on using the changeset viewer.