WordPress.org

Make WordPress Core

Changeset 11897


Ignore:
Timestamp:
09/01/2009 09:15:20 PM (12 years ago)
Author:
westi
Message:

Better feedback on publishing of future posts and pages. Fixes #10711 based on patch from scribu.

Location:
trunk/wp-admin
Files:
4 edited

Legend:

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

    r11815 r11897  
    2828$messages[7] = __('Post saved.');
    2929$messages[8] = sprintf(__('Post submitted. <a href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
     30// translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php
     31$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));
    3032
    3133if ( isset($_GET['revision']) )
  • trunk/wp-admin/edit-page-form.php

    r11815 r11897  
    2828$messages[5] = sprintf(__('Page published. <a href="%s">View page</a>'), get_permalink($post_ID));
    2929$messages[6] = sprintf(__('Page submitted. <a href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) );
     30// translators: Publish box date formt, see http://php.net/date - Same as in meta-boxes.php
     31$messages[7] = sprintf(__('Page 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));
    3032
    3133if ( isset($_GET['revision']) )
  • trunk/wp-admin/page.php

    r11807 r11897  
    3838    } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
    3939        if ( isset( $_POST['publish'] ) ) {
    40             if ( 'pending' == get_post_status( $page_ID ) )
    41                 $location = add_query_arg( 'message', 6, get_edit_post_link( $page_ID, 'url' ) );
    42             else
    43                 $location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) );
     40            switch ( get_post_status( $page_ID ) ) {
     41                case 'pending':
     42                    $location = add_query_arg( 'message', 6, get_edit_post_link( $page_ID, 'url' ) );
     43                    break;
     44                case 'future':
     45                    $location = add_query_arg( 'message', 7, get_edit_post_link( $page_ID, 'url' ) );
     46                    break;
     47                default:
     48                    $location = add_query_arg( 'message', 5, get_edit_post_link( $page_ID, 'url' ) );
     49            }
    4450        } else {
    4551            $location = add_query_arg( 'message', 1, get_edit_post_link( $page_ID, 'url' ) );
  • trunk/wp-admin/post.php

    r11807 r11897  
    4141    } elseif ( ( isset($_POST['save']) || isset($_POST['publish']) ) ) {
    4242        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' ) );
     43            switch ( get_post_status( $post_ID ) ) {
     44                case 'pending':
     45                    $location = add_query_arg( 'message', 8, get_edit_post_link( $post_ID, 'url' ) );
     46                    break;
     47                case 'future':
     48                    $location = add_query_arg( 'message', 9, get_edit_post_link( $post_ID, 'url' ) );
     49                    break;
     50                default:
     51                    $location = add_query_arg( 'message', 6, get_edit_post_link( $post_ID, 'url' ) );
     52            }
    4753        } else {
    4854            $location = add_query_arg( 'message', 1, get_edit_post_link( $post_ID, 'url' ) );
Note: See TracChangeset for help on using the changeset viewer.