diff --git a/wp-admin/css/wp-admin.css b/wp-admin/css/wp-admin.css index c82bcfd4cf..61dc531008 100644 --- a/wp-admin/css/wp-admin.css +++ b/wp-admin/css/wp-admin.css @@ -3430,8 +3430,8 @@ td.plugin-title p { margin: 25px; } -#notification-dialog .post-locked-message a.button-primary { - margin: 0 10px; +#notification-dialog .post-locked-message a.button { + margin-right: 10px; } #notification-dialog .post-locked-avatar { diff --git a/wp-admin/includes/post.php b/wp-admin/includes/post.php index dfd47b0d5f..a73f28e134 100644 --- a/wp-admin/includes/post.php +++ b/wp-admin/includes/post.php @@ -1198,34 +1198,48 @@ function wp_set_post_lock( $post_id ) { * @return none */ function _admin_notice_post_locked() { - global $post_ID; + if ( ! $post = get_post() ) + return; - if ( !empty( $post_ID ) && ( $user = wp_check_post_lock( $post_ID ) ) ) { + if ( $user = wp_check_post_lock( $post->ID ) ) { $user = get_userdata( $user ); - $locked = apply_filters( 'show_post_locked_dialog', true, $post_ID, $user ); + $locked = apply_filters( 'show_post_locked_dialog', true, $post, $user ); } else { $locked = false; } + $class = $locked ? '' : ' class="hidden"'; + ?> -