From f055ac27d17dd94ad0b123d933d80741e46829e0 Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Mon, 29 Jul 2013 19:25:26 +0000 Subject: [PATCH] Make the `show_post_locked_dialog` filter hide both the post locked and post taken over dialogs props azaozz, DH-Shredder. Fixes #24830 for trunk. git-svn-id: http://core.svn.wordpress.org/trunk@24883 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/includes/post.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) 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() {

- +