Make WordPress Core


Ignore:
Timestamp:
04/15/2021 11:01:12 AM (4 years ago)
Author:
gziolo
Message:

Editor: Backport changes for WordPress packages added in 5.7.1

Props peterwilsoncc.
See #52912.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/blocks/latest-posts.php

    r49226 r50760  
    135135            $trimmed_excerpt = get_the_excerpt( $post );
    136136
     137            if ( post_password_required( $post ) ) {
     138                $trimmed_excerpt = __( 'This content is password protected.' );
     139            }
     140
    137141            $list_items_markup .= sprintf(
    138142                '<div class="wp-block-latest-posts__post-excerpt">%1$s</div>',
     
    143147        if ( isset( $attributes['displayPostContent'] ) && $attributes['displayPostContent']
    144148            && isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) {
     149
     150            $post_content = wp_kses_post( html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset' ) ) );
     151
     152            if ( post_password_required( $post ) ) {
     153                $post_content = __( 'This content is password protected.' );
     154            }
     155
    145156            $list_items_markup .= sprintf(
    146157                '<div class="wp-block-latest-posts__post-full-content">%1$s</div>',
    147                 wp_kses_post( html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset' ) ) )
     158                $post_content
    148159            );
    149160        }
Note: See TracChangeset for help on using the changeset viewer.