Make WordPress Core


Ignore:
Timestamp:
03/03/2008 08:58:06 PM (19 years ago)
Author:
ryan
Message:

Only show "saved at" when the post was actually saved. Props mdawaffe. fixes #6053

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/admin-ajax.php

    r7103 r7138  
    484484        $do_lock = true;
    485485
    486         $data = '<div class="updated"><p>' . sprintf( __('Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) ) . '</p></div>';
     486        $data = '';
     487        $message = '<div class="updated"><p>' . sprintf( __('Saved at %s.'), date( __('g:i:s a'), current_time( 'timestamp', true ) ) ) . '</p></div>';
    487488
    488489        $supplemental = array();
    … …  
    491492        if($_POST['post_ID'] < 0) {
    492493                $_POST['temp_ID'] = $_POST['post_ID'];
    493                 if ( $do_autosave )
     494                if ( $do_autosave ) {
    494495                        $id = wp_write_post();
     496                        $data = $message;
     497                }
    495498        } else {
    496499                $post_ID = (int) $_POST['post_ID'];
    … …  
    518521                                die(__('You are not allowed to edit this post.'));
    519522                }
    520                 if ( $do_autosave )
     523                if ( $do_autosave ) {
    521524                        $id = wp_update_post($_POST);
    522                 else
     525                        $data = $message;
     526                } else {
    523527                        $id = $post->ID;
     528                }
    524529        }
    525530
Note: See TracChangeset for help on using the changeset viewer.