Changeset 7907 for trunk/wp-admin/edit-form-advanced.php
- Timestamp:
- 05/08/2008 05:25:07 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-admin/edit-form-advanced.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/edit-form-advanced.php
r7888 r7907 1 <?php 2 $action = isset($action)? $action : ''; 1 <?php 2 3 $action = isset($action) ? $action : ''; 3 4 if ( isset($_GET['message']) ) 4 5 $_GET['message'] = absint( $_GET['message'] ); … … 7 8 $messages[3] = __('Custom field deleted.'); 8 9 $messages[4] = __('Post updated.'); 9 $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_time( $_GET['revision'] ) ); 10 ?> 11 <?php if (isset($_GET['message'])) : ?> 12 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div> 13 <?php endif; ?> 14 15 <form name="post" action="post.php" method="post" id="post"> 16 <?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?> 17 <input type="hidden" name="mode" value="bookmarklet" /> 18 <?php endif; ?> 19 20 <div class="wrap"> 21 <h2><?php _e('Write Post') ?></h2> 22 <?php 23 24 if (!isset($post_ID) || 0 == $post_ID) { 10 $messages[5] = sprintf( __('Post restored to revision from %s'), wp_post_revision_title( $_GET['revision'], false ) ); 11 12 $notice = false; 13 $notices[1] = __( 'There is an autosave of this post that is more recent than the version below. <a href="%s">View the autosave</a>.' ); 14 15 if ( !isset($post_ID) || 0 == $post_ID ) { 25 16 $form_action = 'post'; 26 17 $temp_ID = -1 * time(); // don't change this formula without looking at wp_write_post() 27 18 $form_extra = "<input type='hidden' id='post_ID' name='temp_ID' value='$temp_ID' />"; 28 wp_nonce_field('add-post');19 $autosave = false; 29 20 } else { 30 21 $post_ID = (int) $post_ID; 31 22 $form_action = 'editpost'; 32 23 $form_extra = "<input type='hidden' id='post_ID' name='post_ID' value='$post_ID' />"; 24 $autosave = wp_get_autosave( $post_id ); 25 if ( $autosave && mysql2date( 'U', $autosave->post_modified_gmt ) > mysql2date( 'U', $post->post_modified_gmt ) ) 26 $notice = sprintf( $notices[1], get_edit_post_link( $autosave->ID ) ); 27 } 28 29 ?> 30 <?php if ( $notice ) : ?> 31 <div id="notice" class="error"><p><?php echo $notice ?></p></div> 32 <?php endif; ?> 33 <?php if (isset($_GET['message'])) : ?> 34 <div id="message" class="updated fade"><p><?php echo $messages[$_GET['message']]; ?></p></div> 35 <?php endif; ?> 36 37 <form name="post" action="post.php" method="post" id="post"> 38 <?php if ( (isset($mode) && 'bookmarklet' == $mode) || isset($_GET['popupurl']) ): ?> 39 <input type="hidden" name="mode" value="bookmarklet" /> 40 <?php endif; ?> 41 42 <div class="wrap"> 43 <h2><?php _e('Write Post') ?></h2> 44 <?php 45 46 if ( !isset($post_ID) || 0 == $post_ID) 47 wp_nonce_field('add-post'); 48 else 33 49 wp_nonce_field('update-post_' . $post_ID); 34 }35 50 36 51 $form_pingback = '<input type="hidden" name="post_pingback" value="' . (int) get_option('default_pingback_flag') . '" id="post_pingback" />';
Note: See TracChangeset
for help on using the changeset viewer.