Make WordPress Core

Ticket #38067: 38067.patch

File 38067.patch, 1.3 KB (added by sebastian.pisula, 8 years ago)
  • wp-admin/includes/post.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
     
    14581458        /** This filter is documented in wp-admin/includes/ajax-actions.php */
    14591459        $time_window = apply_filters( 'wp_check_post_lock_window', 150 );
    14601460
    1461         if ( $time && $time > time() - $time_window && $user != get_current_user_id() )
    1462                 return $user;
    1463         return false;
     1461        $lock_status = false;
     1462
     1463        if ( $time && $time > time() - $time_window && $user != get_current_user_id() ) {
     1464                $lock_status = $user;
     1465        }
     1466
     1467        /**
     1468         * Filters whether to filter lock status.
     1469         *
     1470         * @since 4.7.0
     1471         *
     1472         * @param bool|int  $lock_status    User ID of user with lock or false.
     1473         * @param int       $post_id        ID of the post to check for editing.
     1474         * @param int       $time           Time of locked post.
     1475         * @param int       $time_window    The interval in seconds the post lock duration.
     1476         * @param int       $user           User ID of user with lock.
     1477         */
     1478        return apply_filters( 'wp_post_lock_status', $lock_status, $post_id, $time, $time_window, $user );
    14641479}
    14651480
    14661481/**