WordPress.org

Make WordPress Core

Ticket #4416: wp-admin-post.diff

File wp-admin-post.diff, 1.2 KB (added by jhodgdon, 11 years ago)

Patches to wp-admin/post.php and wp-admin/post-new.php, which make it so Save and Continue Editing on a blank post goes to new Write screen with warning message at top of screen

  • E:/EclipseWork/WordPressDev/wp-admin/post-new.php

     
    2525<?php
    2626endif;
    2727
     28if ( isset($_GET['was_empty']) && $_GET['was_empty'] ) : ?>
     29<div id="message" class="updated fade"><p><strong><?php _e('Empty post not saved.'); ?></strong></p></div>
     30<?php
     31endif;
     32
    2833if ( $drafts = get_users_drafts( $user_ID ) ) { ?>
    2934<div class="wrap">
    3035<p><strong><?php _e('Your Drafts:') ?></strong>
  • E:/EclipseWork/WordPressDev/wp-admin/post.php

     
    3131                        $location = 'post-new.php';
    3232                        break;
    3333                }
     34        } else if( $post_ID ) {
     35                $location = "post-new.php?posted=$post_ID";
    3436        } else {
    35                 $location = "post-new.php?posted=$post_ID";
     37                $location = 'post-new.php?was_empty=1';
    3638        }
    3739
    38         if ( isset($_POST['save']) )
     40        if ( isset($_POST['save']) && $post_ID )
    3941                $location = "post.php?action=edit&post=$post_ID";
    4042
    4143        wp_redirect($location);