From eb4f4bc87e482ae90000b33a4856bd740ec20324 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Thu, 5 Oct 2017 02:49:15 +0000 Subject: [PATCH] Administration: Add `.protected-post-excerpt` class to password-protected post excerpts in the posts list. Props Soean, mp518, slaFFik, SergeyBiryukov. Fixes #41426. git-svn-id: https://develop.svn.wordpress.org/trunk@41770 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/class-wp-posts-list-table.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/class-wp-posts-list-table.php b/src/wp-admin/includes/class-wp-posts-list-table.php index 5395a0beac..5988c3eaca 100644 --- a/src/wp-admin/includes/class-wp-posts-list-table.php +++ b/src/wp-admin/includes/class-wp-posts-list-table.php @@ -949,7 +949,11 @@ class WP_Posts_List_Table extends WP_List_Table { echo "\n"; if ( ! is_post_type_hierarchical( $this->screen->post_type ) && 'excerpt' === $mode && current_user_can( 'read_post', $post->ID ) ) { - echo esc_html( get_the_excerpt() ); + if ( post_password_required( $post ) ) { + echo '' . esc_html( get_the_excerpt() ) . ''; + } else { + echo esc_html( get_the_excerpt() ); + } } get_inline_data( $post );