Make WordPress Core


Ignore:
Timestamp:
03/12/2013 03:22:30 AM (11 years ago)
Author:
azaozz
Message:

Check post locks with heartbeat and display modal notifications when a post is locked or a user takes over editing, props dh-shredder, see #23697

File:
1 edited

Legend:

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

    r23639 r23661  
    10581058
    10591059    if ( $last = wp_check_post_lock( $post->ID ) ) {
     1060        // This will change after we have per-user autosaves
    10601061        $do_autosave = $do_lock = false;
    10611062
     
    10651066
    10661067        $supplemental['disable_autosave'] = 'disable';
    1067         $alert .= sprintf( __( '%s is currently editing this article. If you update it, you will overwrite the changes.' ), esc_html( $last_user_name ) );
    10681068    }
    10691069
     
    10931093        else
    10941094            $id = $post->ID;
    1095     }
    1096 
    1097     if ( $do_lock && empty( $_POST['auto_draft'] ) && $id && is_numeric( $id ) ) {
    1098         $lock_result = wp_set_post_lock( $id );
    1099         $supplemental['active-post-lock'] = implode( ':', $lock_result );
    11001095    }
    11011096
     
    17781773        wp_die( 0 );
    17791774
    1780     $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', AUTOSAVE_INTERVAL * 2 ) + 5 ) . ':' . $active_lock[1];
     1775    $new_lock = ( time() - apply_filters( 'wp_check_post_lock_window', 120 ) + 5 ) . ':' . $active_lock[1];
    17811776    update_post_meta( $post_id, '_edit_lock', $new_lock, implode( ':', $active_lock ) );
    17821777    wp_die( 1 );
Note: See TracChangeset for help on using the changeset viewer.