Make WordPress Core


Ignore:
Timestamp:
05/02/2009 09:44:09 PM (16 years ago)
Author:
ryan
Message:

Clean up save mssage. see #8713

File:
1 edited

Legend:

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

    r10094 r11159  
    3939        elseif ( isset($_POST['publish']) )
    4040            $location = 'sidebar.php?a=b';
    41     } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) && ( empty($referredby) || $referredby == $referer || 'redo' != $referredby ) ) {
    42         if ( isset($_POST['_wp_original_http_referer']) && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post.php') === false && strpos( $_POST['_wp_original_http_referer'], '/wp-admin/post-new.php') === false )
    43             $location = add_query_arg( array(
    44                 '_wp_original_http_referer' => urlencode( stripslashes( $_POST['_wp_original_http_referer'] ) ),
    45                 'message' => 1
    46             ), get_edit_post_link( $post_ID, 'url' ) );
    47         else {
    48             if ( isset( $_POST['publish'] ) ) {
    49                 if ( 'pending' == get_post_status( $post_ID ) )
    50                     $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) );
    51                 else
    52                     $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) );
    53             } else {
    54                 $location = add_query_arg( 'message', 7, get_edit_post_link( $post_ID, 'url' ) );
    55             }
     41    } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
     42        if ( isset( $_POST['publish'] ) ) {
     43            if ( 'pending' == get_post_status( $post_ID ) )
     44                $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) );
     45            else
     46                $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) );
     47        } else {
     48            $location = add_query_arg( 'message', 1, get_edit_post_link( $post_ID, 'url' ) );
    5649        }
    5750    } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
     
    6356        $location = explode('#', $location);
    6457        $location = $location[0] . '#postcustom';
    65     } elseif (!empty($referredby) && $referredby != $referer) {
    66         $location = $_POST['referredby'];
    67         $location = remove_query_arg('_wp_original_http_referer', $location);
    68         if ( false !== strpos($location, 'edit.php') || false !== strpos($location, 'edit-post-drafts.php') )
    69             $location = add_query_arg('posted', $post_ID, $location);
    70         elseif ( false !== strpos($location, 'wp-admin') )
    71             $location = "post-new.php?posted=$post_ID";
    72     } elseif ( isset($_POST['publish']) ) {
    73         $location = "post-new.php?posted=$post_ID";
    7458    } elseif ($action == 'editattachment') {
    7559        $location = 'attachments.php';
Note: See TracChangeset for help on using the changeset viewer.