Make WordPress Core

Ticket #11082: #11082_new.patch

File #11082_new.patch, 2.0 KB (added by akhilasuram, 15 years ago)
  • edit-form-advanced.php

     
    3333        sprintf( __('Post submitted. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ),
    3434        // translators: Publish box date format, see http://php.net/date - Same as in meta-boxes.php
    3535        sprintf( __('Post scheduled for: <b>%1$s</b>. <a target="_blank" href="%2$s">Preview post</a>'), date_i18n( __( 'M j, Y @ G:i' ), strtotime( $post->post_date ) ), get_permalink($post_ID) ),
    36         sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) )
     36        sprintf( __('Post draft updated. <a target="_blank" href="%s">Preview post</a>'), add_query_arg( 'preview', 'true', get_permalink($post_ID) ) ),
     37        __('You attempted to save or publish an empty post. Provide some content before saving.')
    3738);
    3839$messages['page'] = array(
    3940        '',
  • post.php

     
    5757                elseif ( isset($_POST['publish']) )
    5858                        $location = 'sidebar.php?a=b';
    5959        } elseif ( isset($_POST['save']) || isset($_POST['publish']) ) {
     60                if( 0== $post_id ){
     61                        $location = "post-new.php?message=11";
     62                        wp_redirect($location);
     63                        exit();
     64                } else {
    6065                $status = get_post_status( $post_id );
    6166
    6267                if ( isset( $_POST['publish'] ) ) {
     
    7378                } else {
    7479                                $message = 'draft' == $status ? 10 : 1;
    7580                }
     81                }
    7682
    7783                $location = add_query_arg( 'message', $message, get_edit_post_link( $post_id, 'url' ) );
    7884        } elseif ( isset($_POST['addmeta']) && $_POST['addmeta'] ) {
     
    278284        wp_redirect($url);
    279285        exit();
    280286        break;
    281 
    282 default:
    283         if ( $post_type_object->hierarchical )
    284                 wp_redirect('edit-pages.php');
    285         else
    286                 wp_redirect('edit.php');
    287         exit();
    288         break;
    289287} // end switch
    290288include('admin-footer.php');
    291289?>