Make WordPress Core

Ticket #11082: 11082.4.diff

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

     
    4949                // translators: Publish box date format, see http://php.net/date
    5050                date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), esc_url( get_permalink($post_ID) ) ),
    5151        sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
     52        __('You attempted to save or publish an empty post. Provide some content before saving.')
    5253);
    5354$messages['page'] = array(
    5455        '',
     
    6263        sprintf( __('Page submitted. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
    6364        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 ) ), esc_url( get_permalink($post_ID) ) ),
    6465        sprintf( __('Page draft updated. <a target="_blank" href="%s">Preview page</a>'), esc_url( add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ) ),
     66        __('You attempted to save or publish an empty page. Provide some content before saving.')
    6567);
    6668
    6769$message = false;
  • wp-admin/post.php

     
    5858                        $location = 'sidebar.php?a=b';
    5959        } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) {
    6060                $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;
    72                         }
     61               
     62                if ( 'auto-draft' == $status ) {
     63                        $location = 'post-new.php?message=11';
     64                        if ( isset( $_POST['post_type'] ) ) {
     65                                $post_type_object = get_post_type_object($_POST['post_type']);
     66                                if ( $post_type_object && 'post' != $post_type_object->name )
     67                                        $location = add_query_arg( 'post_type', $post_type_object->name, $location );
     68                        }
    7369                } else {
     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);