From 99488cb638e4430ecac4980820518fda43381bea Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 15 Mar 2013 21:09:20 +0000 Subject: [PATCH] Post locks: add Preview button when post is locked, fix the suggested places, see #23312 git-svn-id: http://core.svn.wordpress.org/trunk@23725 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/css/wp-admin.css | 4 ++-- wp-admin/includes/post.php | 28 +++++++++++++++++++++------- wp-admin/js/post.js | 2 +- 3 files changed, 24 insertions(+), 10 deletions(-) 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"'; + ?> -