Make WordPress Core


Ignore:
Timestamp:
05/09/2008 03:59:17 PM (16 years ago)
Author:
ryan
Message:

Revisioning for pages from mdawaffe. see #6775

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-page-form.php

    r7883 r7913  
    66$messages[3] = __('Custom field deleted.');
    77$messages[4] = __('Page updated.');
    8 ?>
    9 <?php if (isset($_GET['message'])) : ?>
    10 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
    11 <?php endif;
     8
     9$notice = false;
     10$notices[1] = __( 'There is an autosave of this page that is more recent than the version below.  <a href="%s">View the autosave</a>.' );
    1211
    1312if (!isset($post_ID) || 0 == $post_ID) {
     
    2120    $nonce_action = 'update-page_' . $post_ID;
    2221    $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />";
     22    $autosave = wp_get_autosave( $post_id );
     23    if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) )
     24        $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) );
    2325}
    2426
     
    3133    $sendto = 'redo';
    3234?>
     35
     36<?php if ( $notice ) : ?>
     37<div id="notice" class="error"><p><?php echo $notice ?></p></div>
     38<?php endif; ?>
     39<?php if (isset($_GET['message'])) : ?>
     40<div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div>
     41<?php endif; ?>
    3342
    3443<form name="post" action="page.php" method="post" id="post">
     
    4554<input type="hidden" id="hiddenaction" name="action" value='<?php echo $form_action ?>' />
    4655<input type="hidden" id="originalaction" name="originalaction" value="<?php echo $form_action ?>" />
     56<input type="hidden" id="post_author" name="post_author" value="<?php echo attribute_escape( $post->post_author ); ?>" />
    4757<?php echo $form_extra ?>
    4858<input type="hidden" id="post_type" name="post_type" value="<?php echo $post->post_type ?>" />
     
    283293<?php endif; ?>
    284294
     295<?php if ( isset($post_ID) && 0 < $post_ID && wp_get_post_revisions( $post_ID ) ) : ?>
     296<div id="revisionsdiv" class="postbox <?php echo postbox_classes('revisionsdiv', 'page'); ?>">
     297<h3><?php _e('Page Revisions'); ?></h3>
     298<div class="inside">
     299<?php wp_list_post_revisions(); ?>
     300</div>
     301</div>
     302<?php endif; ?>
     303
     304
    285305<?php do_meta_boxes('page', 'advanced', $post); ?>
    286306
Note: See TracChangeset for help on using the changeset viewer.