Make WordPress Core


Ignore:
Timestamp:
04/22/2013 03:08:51 AM (11 years ago)
Author:
azaozz
Message:

Post locks:

  • Show 'Saving revision...' while autosaving after a post has been taken over. Change to 'Your latest changes were saved as a revision.' when autosave completes.
  • Make sure a user exists before using $user->display_name.
  • Add 'post_lock_text' action for extending the message text.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r24021 r24042  
    11981198        return;
    11991199
    1200     if ( $user = wp_check_post_lock( $post->ID ) ) {
    1201         $user = get_userdata( $user );
     1200    if ( ( $user_id = wp_check_post_lock( $post->ID ) ) && ( $user = get_userdata( $user_id ) ) ) {
    12021201        $locked = apply_filters( 'show_post_locked_dialog', true, $post, $user );
    12031202    } else {
     
    12301229        <div class="post-locked-avatar"><?php echo get_avatar( $user->ID, 64 ); ?></div>
    12311230        <p class="currently-editing wp-tab-first" tabindex="0"><?php esc_html_e( sprintf( __( 'This content is currently locked. If you take over, %s will be blocked from continuing to edit.' ), $user->display_name ) ); ?></p>
     1231        <?php do_action( 'post_lock_text', $post ); ?>
    12321232        <p>
    12331233        <a class="button" href="<?php echo esc_url( wp_get_referer() ); ?>"><?php _e('Go back'); ?></a>
     
    12501250        <div class="post-taken-over">
    12511251            <div class="post-locked-avatar"></div>
    1252             <p class="currently-editing wp-tab-first" tabindex="0"></p>
     1252            <p class="wp-tab-first" tabindex="0">
     1253            <span class="currently-editing"></span><br>
     1254            <span class="locked-saving hidden"><img src="images/wpspin_light-2x.gif" width="16" height="16" /> <?php _e('Saving revision...'); ?></span>
     1255            <span class="locked-saved hidden"><?php _e('Your latest changes were saved as a revision.'); ?></span>
     1256            </p>
     1257            <?php do_action( 'post_lock_text', $post ); ?>
    12531258            <p><a class="button button-primary wp-tab-last" href="<?php echo esc_url( admin_url('edit.php') ); ?>"><?php _e('Go to All Posts'); ?></a></p>
    12541259        </div>
Note: See TracChangeset for help on using the changeset viewer.