Make WordPress Core

Changeset 24762


Ignore:
Timestamp:
07/22/2013 05:09:49 AM (11 years ago)
Author:
nacin
Message:

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

Location:
trunk/wp-admin
Files:
3 edited

Legend:

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

    r24743 r24762  
    2929    wp_enqueue_media( array( 'post' => $post_ID ) );
    3030}
     31
     32// Add the local autosave notice HTML
     33add_action( 'admin_footer', '_local_storage_notice' );
    3134
    3235$messages = array();
  • trunk/wp-admin/includes/misc.php

    r24594 r24762  
    666666}
    667667add_filter( 'heartbeat_received', 'wp_refresh_post_nonces', 10, 3 );
    668 
    669 /**
    670  * Output the HTML for restoring the post data from DOM storage
    671  *
    672  * @since 3.6
    673  * @access private
    674  */
    675 function _local_storage_notice() {
    676     $screen = get_current_screen();
    677     if ( ! $screen || 'post' != $screen->id )
    678         return;
    679 
    680     ?>
    681     <div id="local-storage-notice" class="hidden">
    682     <p class="local-restore">
    683         <?php _e('The backup of this post in your browser is different from the version below.'); ?>
    684         <a class="restore-backup" href="#"><?php _e('Restore the backup.'); ?></a>
    685     </p>
    686     <p class="undo-restore hidden">
    687         <?php _e('Post restored successfully.'); ?>
    688         <a class="undo-restore-backup" href="#"><?php _e('Undo.'); ?></a>
    689     </p>
    690     </div>
    691     <?php
    692 }
    693 add_action( 'admin_footer', '_local_storage_notice' );
  • trunk/wp-admin/includes/template.php

    r24734 r24762  
    19301930    return WP_Screen::get( $hook_name );
    19311931}
     1932
     1933/**
     1934 * Output the HTML for restoring the post data from DOM storage
     1935 *
     1936 * @since 3.6
     1937 * @access private
     1938 */
     1939function _local_storage_notice() {
     1940    ?>
     1941    <div id="local-storage-notice" class="hidden">
     1942    <p class="local-restore">
     1943        <?php _e('The backup of this post in your browser is different from the version below.'); ?>
     1944        <a class="restore-backup" href="#"><?php _e('Restore the backup.'); ?></a>
     1945    </p>
     1946    <p class="undo-restore hidden">
     1947        <?php _e('Post restored successfully.'); ?>
     1948        <a class="undo-restore-backup" href="#"><?php _e('Undo.'); ?></a>
     1949    </p>
     1950    </div>
     1951    <?php
     1952}
Note: See TracChangeset for help on using the changeset viewer.