Make WordPress Core


Ignore:
Timestamp:
06/05/2013 03:01:59 AM (12 years ago)
Author:
azaozz
Message:

Post locks:

  • When a post is locked, ensure the 'Go back' button doesn't reload the same screen. If no referrer, change the button from 'Go back' to 'Go to All Posts'/'Go to All Pages' etc.
  • Remove restriction on checking locks only for posts.

See #23697.

File:
1 edited

Legend:

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

    r24406 r24408  
    570570    $checked = array();
    571571
    572     if ( 'edit-post' == $screen_id && array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) {
     572    if ( array_key_exists( 'wp-check-locked-posts', $data ) && is_array( $data['wp-check-locked-posts'] ) ) {
    573573        foreach ( $data['wp-check-locked-posts'] as $key ) {
    574             $post_id = (int) substr( $key, 5 );
    575 
    576             if ( current_user_can( 'edit_post', $post_id ) && ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) ) {
     574            if ( ! $post_id = absint( substr( $key, 5 ) ) )
     575                continue;
     576
     577            if ( ( $user_id = wp_check_post_lock( $post_id ) ) && ( $user = get_userdata( $user_id ) ) && current_user_can( 'edit_post', $post_id ) ) {
    577578                $send = array( 'text' => sprintf( __( '%s is currently editing' ), $user->display_name ) );
    578579
     
    598599 */
    599600function wp_refresh_post_lock( $response, $data, $screen_id ) {
    600     if ( 'post' == $screen_id && array_key_exists( 'wp-refresh-post-lock', $data ) ) {
     601    if ( array_key_exists( 'wp-refresh-post-lock', $data ) ) {
    601602        $received = $data['wp-refresh-post-lock'];
    602603        $send = array();
     
    637638 */
    638639function wp_refresh_post_nonces( $response, $data, $screen_id ) {
    639     if ( 'post' == $screen_id && array_key_exists( 'wp-refresh-post-nonces', $data ) ) {
     640    if ( array_key_exists( 'wp-refresh-post-nonces', $data ) ) {
    640641        $received = $data['wp-refresh-post-nonces'];
    641642
Note: See TracChangeset for help on using the changeset viewer.