Make WordPress Core

Changeset 41770


Ignore:
Timestamp:
10/05/2017 02:49:15 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Administration: Add .protected-post-excerpt class to password-protected post excerpts in the posts list.

Props Soean, mp518, slaFFik, SergeyBiryukov.
Fixes #41426.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-posts-list-table.php

    r41684 r41770  
    950950
    951951        if ( ! is_post_type_hierarchical( $this->screen->post_type ) && 'excerpt' === $mode && current_user_can( 'read_post', $post->ID ) ) {
    952             echo esc_html( get_the_excerpt() );
     952            if ( post_password_required( $post ) ) {
     953                echo '<span class="protected-post-excerpt">' . esc_html( get_the_excerpt() ) . '</span>';
     954            } else {
     955                echo esc_html( get_the_excerpt() );
     956            }
    953957        }
    954958
Note: See TracChangeset for help on using the changeset viewer.