Make WordPress Core


Ignore:
Timestamp:
10/11/2009 12:37:26 AM (14 years ago)
Author:
azaozz
Message:

Open View/Preview post in a new window from the link in the Saved/Updated message, cleanup messages code, add Draft updated for Pages.

File:
1 edited

Legend:

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

    r11986 r12020  
    3636    } elseif ( 'post' == $_POST['originalaction'] && !empty($_POST['mode']) && 'sidebar' == $_POST['mode'] ) {
    3737        $location = 'sidebar.php?a=b';
    38     } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
     38    } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) {
     39        $status = get_post_status( $page_ID );
     40
    3941        if ( isset( $_POST['publish'] ) ) {
    40             switch ( get_post_status( $page_ID ) ) {
     42            switch ( $status ) {
    4143                case 'pending':
    42                     $location = add_query_arg( 'message', 6, get_edit_post_link( $page_ID, 'url' ) );
     44                    $message = 6;
    4345                    break;
    4446                case 'future':
    45                     $location = add_query_arg( 'message', 7, get_edit_post_link( $page_ID, 'url' ) );
     47                    $message = 7;
    4648                    break;
    4749                default:
    48                     $location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) );
     50                    $message = 4;
    4951            }
    5052        } else {
    51             $location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) );
     53                $message = 'draft' == $status ? 8 : 1;
    5254        }
     55
     56        $location = add_query_arg( 'message', $message, get_edit_post_link( $page_ID, 'url' ) );
    5357    } elseif ( isset($_POST['addmeta']) ) {
    5458        $location = add_query_arg( 'message', 2, wp_get_referer() );
Note: See TracChangeset for help on using the changeset viewer.