diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index 9d9ddfd4a3..3f3d02bcf7 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1207,8 +1207,15 @@ function _admin_notice_post_locked() { if ( ! $post = get_post() ) return; - if ( ( $user_id = wp_check_post_lock( $post->ID ) ) && ( $user = get_userdata( $user_id ) ) ) { - $locked = apply_filters( 'show_post_locked_dialog', true, $post, $user ); + $user = null; + if ( $user_id = wp_check_post_lock( $post->ID ) ) + $user = get_userdata( $user_id ); + + if ( $user ) { + if ( ! apply_filters( 'show_post_locked_dialog', true, $post, $user ) ) + return; + + $locked = true; } else { $locked = false; } @@ -1283,7 +1290,7 @@ function _admin_notice_post_locked() {

- +