Make WordPress Core


Ignore:
Timestamp:
08/11/2006 07:13:00 PM (19 years ago)
Author:
ryan
Message:

Fix autosave redirects

File:
1 edited

Legend:

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

    r4087 r4088  
    8686    $page_ID = edit_post();
    8787
    88     if ($_POST['save']) {
    89         $location = "page.php?action=edit&post=$page_ID";
    90     } elseif ($_POST['updatemeta']) {
    91         $location = wp_get_referer() . '&message=2#postcustom';
    92     } elseif ($_POST['deletemeta']) {
    93         $location = wp_get_referer() . '&message=3#postcustom';
    94     } elseif (!empty($_POST['referredby']) && $_POST['referredby'] != wp_get_referer()) {
    95         $location = $_POST['referredby'];
    96         if ( $_POST['referredby'] == 'redo' )
    97             $location = get_permalink( $page_ID );
    98     } elseif ($action == 'editattachment') {
    99         $location = 'attachments.php';
     88    if ( 'post' == $_POST['originalaction'] ) {
     89        if (!empty($_POST['mode'])) {
     90        switch($_POST['mode']) {
     91            case 'bookmarklet':
     92                $location = $_POST['referredby'];
     93                break;
     94            case 'sidebar':
     95                $location = 'sidebar.php?a=b';
     96                break;
     97            default:
     98                $location = 'page-new.php';
     99                break;
     100            }
     101        } else {
     102            $location = 'page-new.php?posted=true';
     103        }
     104
     105        if ( isset($_POST['save']) )
     106            $location = "page.php?action=edit&post=$page_ID";       
    100107    } else {
    101         $location = 'page-new.php';
     108        if ($_POST['save']) {
     109            $location = "page.php?action=edit&post=$page_ID";
     110        } elseif ($_POST['updatemeta']) {
     111            $location = wp_get_referer() . '&message=2#postcustom';
     112        } elseif ($_POST['deletemeta']) {
     113            $location = wp_get_referer() . '&message=3#postcustom';
     114        } elseif (!empty($_POST['referredby']) && $_POST['referredby'] != wp_get_referer()) {
     115            $location = $_POST['referredby'];
     116            if ( $_POST['referredby'] == 'redo' )
     117                $location = get_permalink( $page_ID );
     118        } elseif ($action == 'editattachment') {
     119            $location = 'attachments.php';
     120        } else {
     121            $location = 'page-new.php';
     122        }
    102123    }
    103124    wp_redirect($location); // Send user on their way while we keep working
Note: See TracChangeset for help on using the changeset viewer.