Move _local_storage_notice() to admin/includes/template.php. props azaozz, see #24756.

git-svn-id: http://core.svn.wordpress.org/trunk@24762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2013-07-22 05:09:49 +00:00
parent 13c63d211a
commit c2a543566c
3 changed files with 24 additions and 26 deletions

View File

@ -29,6 +29,9 @@ if ( post_type_supports($post_type, 'editor') || post_type_supports($post_type,
wp_enqueue_media( array( 'post' => $post_ID ) );
}
// Add the local autosave notice HTML
add_action( 'admin_footer', '_local_storage_notice' );
$messages = array();
$messages['post'] = array(
0 => '', // Unused. Messages start at index 1.

View File

@ -665,29 +665,3 @@ function wp_refresh_post_nonces( $response, $data, $screen_id ) {
return $response;
}
add_filter( 'heartbeat_received', 'wp_refresh_post_nonces', 10, 3 );
/**
* Output the HTML for restoring the post data from DOM storage
*
* @since 3.6
* @access private
*/
function _local_storage_notice() {
$screen = get_current_screen();
if ( ! $screen || 'post' != $screen->id )
return;
?>
<div id="local-storage-notice" class="hidden">
<p class="local-restore">
<?php _e('The backup of this post in your browser is different from the version below.'); ?>
<a class="restore-backup" href="#"><?php _e('Restore the backup.'); ?></a>
</p>
<p class="undo-restore hidden">
<?php _e('Post restored successfully.'); ?>
<a class="undo-restore-backup" href="#"><?php _e('Undo.'); ?></a>
</p>
</div>
<?php
}
add_action( 'admin_footer', '_local_storage_notice' );

View File

@ -1929,3 +1929,24 @@ function convert_to_screen( $hook_name ) {
return WP_Screen::get( $hook_name );
}
/**
* Output the HTML for restoring the post data from DOM storage
*
* @since 3.6
* @access private
*/
function _local_storage_notice() {
?>
<div id="local-storage-notice" class="hidden">
<p class="local-restore">
<?php _e('The backup of this post in your browser is different from the version below.'); ?>
<a class="restore-backup" href="#"><?php _e('Restore the backup.'); ?></a>
</p>
<p class="undo-restore hidden">
<?php _e('Post restored successfully.'); ?>
<a class="undo-restore-backup" href="#"><?php _e('Undo.'); ?></a>
</p>
</div>
<?php
}