From 712fcec00bda09e872b0b314ef272ac9474732a2 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 2 Feb 2013 01:31:06 +0000 Subject: [PATCH] Posts screen: show when a post is "locked", hide the checkbox, Quick Edit and Trash links, props dh-shredder, see #23312 git-svn-id: https://develop.svn.wordpress.org/trunk@23371 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-admin/css/wp-admin.css | 19 +++++++ wp-admin/images/lock16.png | Bin 0 -> 335 bytes .../includes/class-wp-posts-list-table.php | 50 ++++++++++++++---- 3 files changed, 59 insertions(+), 10 deletions(-) create mode 100644 wp-admin/images/lock16.png diff --git a/wp-admin/css/wp-admin.css b/wp-admin/css/wp-admin.css index 5000bba965..30c8080672 100644 --- a/wp-admin/css/wp-admin.css +++ b/wp-admin/css/wp-admin.css @@ -2527,6 +2527,25 @@ table.fixed { background-repeat: no-repeat; } +tr.wp-locked .locked-indicator { + background: url('../images/lock16.png') no-repeat; + margin: -2px 0 0 8px; + height: 16px; + width: 16px; +} + +tr.wp-locked .check-column label, +tr.wp-locked .check-column input[type="checkbox"], +tr.wp-locked .row-actions .inline, +tr.wp-locked .row-actions .trash, +.lock-holder { + display: none; +} + +tr.wp-locked .lock-holder { + display: inline; +} + .fixed .column-comments .sorting-indicator { margin-top: 3px; } diff --git a/wp-admin/images/lock16.png b/wp-admin/images/lock16.png new file mode 100644 index 0000000000000000000000000000000000000000..8f66ac57325325ae27c18eaecb074e9a83aebbef GIT binary patch literal 335 zcmV-V0kHmwP)6&s;cBkDILHKyuk4>&{mlJ z9!%j$o-`UTBKV+y6z>YS=d>ozbOpmN^Jd=6yoH{HB4}D_ttwFzMT`9jtOI3np=-64 zwVrY9n%jT#)ABa}4zWy7N9Q7V`ZkSBd-vkO}=l#|Mwxs-^ef${32&awk6`b* heY(rm7lBKKegPaLx^V`LuF(Jh002ovPDHLkV1gK}mMQ=M literal 0 HcmV?d00001 diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index 2f47867798..f0ba11c39a 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -472,9 +472,19 @@ class WP_Posts_List_Table extends WP_List_Table { $title = _draft_or_post_title(); $post_type_object = get_post_type_object( $post->post_type ); $can_edit_post = current_user_can( $post_type_object->cap->edit_post, $post->ID ); + $lock_holder_id = wp_check_post_lock( $post->ID ); + $lock_holder = ''; $alternate = 'alternate' == $alternate ? '' : 'alternate'; $classes = $alternate . ' iedit author-' . ( get_current_user_id() == $post->post_author ? 'self' : 'other' ); + + if ( $lock_holder_id ) { + $classes .= ' wp-locked'; + $lock_holder_data = get_user_by( 'id', $lock_holder_id ); + + if ( $lock_holder_data ) + $lock_holder = esc_html( sprintf( __('Currently edited by %s'), $lock_holder_data->data->display_name ) ); + } ?> - + - +
+ - >post_status != 'trash' ) { ?>labels->parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?> - + >post_status != 'trash' ) { ?>labels->parent_item_colon . ' ' . esc_html( $parent_name ) : ''; ?> + post_status != 'trash' ) { + ?> + + - >post_status != 'trash' ) { ?> - + >post_status != 'trash' ) { ?> + post_status != 'trash' ) { + ?> + + ID ) ) the_excerpt(); }