mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-31 13:37:51 +01:00
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:
parent
13c63d211a
commit
c2a543566c
@ -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.
|
||||
|
@ -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' );
|
||||
|
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user