Make WordPress Core

Ticket #11082: 11082.2.diff

File 11082.2.diff, 3.8 KB (added by duck_, 15 years ago)
  • wp-admin/edit-form-advanced.php

     
    3535        sprintf( __('Post scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview post</a>'),
    3636                // translators: Publish box date format, see http://php.net/date
    3737                date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) ),
    38         sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) )
     38        sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ),
     39        __('You attempted to save or publish an empty post. Provide some content before saving.')
    3940);
    4041$messages['page'] = array(
    4142        '',
     
    4849        __('Page saved.'),
    4950        sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ),
    5051        sprintf( __('Page scheduled for: <strong>%1$s</strong>. <a target="_blank" href="%2$s">Preview page</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) ),
    51         sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) )
     52        sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ),
     53        __('You attempted to save or publish an empty page. Provide some content before saving.')
    5254);
    5355
    5456$message = false;
  • wp-admin/post.php

     
    5757                elseif ( isset($_POST['publish']) )
    5858                        $location = 'sidebar.php?a=b';
    5959        } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) {
    60                 $status = get_post_status( $post_id );
    61 
    62                 if ( isset( $_POST['publish'] ) ) {
    63                         switch ( $status ) {
    64                                 case 'pending':
    65                                         $message = 8;
    66                                         break;
    67                                 case 'future':
    68                                         $message = 9;
    69                                         break;
    70                                 default:
    71                                         $message = 6;
     60                if ( isset( $_POST['auto_draft'] ) && '1' == $_POST['auto_draft'] ) {
     61                        $location = 'post-new.php?message=11';
     62                        if ( isset($_POST['post_type']) ) {
     63                                $post_type_object = get_post_type_object($_POST['post_type']);
     64                                if ( $post_type_object && 'post' != $post_type_object->name )
     65                                        $location = add_query_arg( 'post_type', $post_type_object->name, $location );
    7266                        }
    7367                } else {
     68                        $status = get_post_status( $post_id );
     69               
     70                        if ( isset( $_POST['publish'] ) ) {
     71                                switch ( $status ) {
     72                                        case 'pending':
     73                                                $message = 8;
     74                                                break;
     75                                        case 'future':
     76                                                $message = 9;
     77                                                break;
     78                                        default:
     79                                                $message = 6;
     80                                }
     81                        } else {
    7482                                $message = 'draft' == $status ? 10 : 1;
     83                        }
     84                       
     85                        $location = add_query_arg( 'message', $message, get_edit_post_link( $post_id, 'url' ) );
    7586                }
    76 
    77                 $location = add_query_arg( 'message', $message, get_edit_post_link( $post_id, 'url' ) );
    7887        } elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) {
    7988                $location = add_query_arg( 'message', 2, wp_get_referer() );
    8089                $location = explode('#', $location);
  • wp-includes/js/autosave.dev.js

     
    144144
    145145function autosave_update_post_ID( postID ) {
    146146        if ( !isNaN(postID) && postID > 0 ) {
    147                 if ( postID == parseInt(jQuery('#post_ID').val(), 10) ) { return; } // no need to do this more than once
    148147                notSaved = false;
    149148                autosave_enable_buttons();
    150149                jQuery('#delete-action a.submitdelete').fadeIn();