WordPress.org

Make WordPress Core

Changeset 12017


Ignore:
Timestamp:
10/10/2009 07:24:05 AM (9 years ago)
Author:
azaozz
Message:

Show "Draft updated" instead of "Post updated" when saving drafts.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r12007 r12017  
    3030// translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php
    3131$messages[9] = sprintf(__('Post scheduled for: <b>%1$s</b>. <a href="%2$s">Preview post</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID));
     32$messages[10] = sprintf(__('Draft updated. <a href="%s">Preview</a>'), get_permalink($post_ID));
    3233
    3334if ( isset($_GET['revision']) )
  • trunk/wp-admin/post.php

    r12007 r12017  
    3939        elseif ( isset($_POST['publish']) )
    4040            $location = 'sidebar.php?a=b';
    41     } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
     41    } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) {
     42        $status = get_post_status( $post_ID );
     43        $link = get_edit_post_link( $post_ID, 'url' );
     44
    4245        if ( isset( $_POST['publish'] ) ) {
    43             switch ( get_post_status( $post_ID ) ) {
     46            switch ( $status ) {
    4447                case 'pending':
    45                     $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) );
     48                    $message = 8;
    4649                    break;
    4750                case 'future':
    48                     $location = add_query_arg( 'message', 9, get_edit_post_link( $post_ID, 'url' ) );
     51                    $message = 9;
    4952                    break;
    5053                default:
    51                     $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) );
     54                    $message = 6;
    5255            }
    5356        } else {
    54             $location = add_query_arg( 'message', 1, get_edit_post_link( $post_ID, 'url' ) );
     57                $message = 'draft' == $status ? 10 : 1;
    5558        }
    56     } elseif (isset($_POST['addmeta']) && $_POST['addmeta']) {
     59
     60        $location = add_query_arg( 'message', $message, $link );
     61    } elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) {
    5762        $location = add_query_arg( 'message', 2, wp_get_referer() );
    5863        $location = explode('#', $location);
    5964        $location = $location[0] . '#postcustom';
    60     } elseif (isset($_POST['deletemeta']) && $_POST['deletemeta']) {
     65    } elseif ( isset($_POST['deletemeta']) && $_POST['deletemeta'] ) {
    6166        $location = add_query_arg( 'message', 3, wp_get_referer() );
    6267        $location = explode('#', $location);
Note: See TracChangeset for help on using the changeset viewer.