Make WordPress Core

Changeset 7084


Ignore:
Timestamp:
02/28/2008 07:34:13 AM (18 years ago)
Author:
ryan
Message:

Change save post redirects. see #6024

File:
1 edited

Legend:

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

    r6983 r7084  
    102102
    103103    $post_ID = edit_post();
     104    $post = get_post($post_ID);
    104105
    105106    if ( 'post' == $_POST['originalaction'] ) {
     
    128129        $referer = preg_replace('|https?://[^/]+|i', '', wp_get_referer());
    129130
    130         if (isset($_POST['addmeta']) && $_POST['addmeta']) {
     131        if ( isset($_POST['save']) && ( 'draft' == $post->post_status || 'pending' == $post->post_status ) ) {
     132            $location = "post.php?action=edit&post=$post_ID";
     133        } elseif ( isset($_POST['save']) && (empty($referredby) || $referredby == $referer) ) {
     134            $location = "post.php?action=edit&post=$post_ID";
     135        } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
    131136            $location = add_query_arg( 'message', 2, wp_get_referer() );
    132137            $location = explode('#', $location);
     
    142147            if (false !== strpos($location, 'edit.php') )
    143148                $location = add_query_arg('posted', $post_ID, $location);
     149        } elseif ( isset($_POST['publish']) ) {
     150            $location = "post-new.php?posted=$post_ID";
    144151        } elseif ($action == 'editattachment') {
    145152            $location = 'attachments.php';
Note: See TracChangeset for help on using the changeset viewer.