Make WordPress Core


Ignore:
Timestamp:
04/12/2022 03:10:30 PM (3 years ago)
Author:
gziolo
Message:

Editor: Update WordPress packages based based on Gutenberg v13.0 RC3

This is the last step of backports from the Gutenberg plugin for WordPress 6.0 Beta 1 release. It includes all updates WordPress packages published to npm based on the Gutenberg plugin v13.0 RC3 release. This patch also includes all the necessary changes applied to core blocks. New blocks included:

  • Avatar
  • Comment Author Name
  • Comment Content
  • Comment Date
  • Comment Edit Link
  • Comment Rely Link
  • Comment Template
  • Comments Pagination
  • Comments Pagination Next
  • Comments Pagination Previous
  • Comments Query Loop
  • Home Link
  • Post Author Biography
  • Query No Results
  • Read More

See more details in https://github.com/WordPress/wordpress-develop/pull/2564.

Props zieladam, ramonopoly, ocean90.
Fixes #55505.

File:
1 edited

Legend:

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

    r50761 r53157  
    6161    foreach ( $recent_posts as $post ) {
    6262        $post_link = esc_url( get_permalink( $post ) );
     63        $title     = get_the_title( $post );
     64
     65        if ( ! $title ) {
     66            $title = __( '(no title)' );
     67        }
    6368
    6469        $list_items_markup .= '<li>';
     
    8287                $attributes['featuredImageSizeSlug'],
    8388                array(
    84                     'style' => $image_style,
     89                    'style' => esc_attr( $image_style ),
    8590                )
    8691            );
    8792            if ( $attributes['addLinkToFeaturedImage'] ) {
    8893                $featured_image = sprintf(
    89                     '<a href="%1$s">%2$s</a>',
    90                     $post_link,
     94                    '<a href="%1$s" aria-label="%2$s">%3$s</a>',
     95                    esc_url( $post_link ),
     96                    esc_attr( $title ),
    9197                    $featured_image
    9298                );
     
    94100            $list_items_markup .= sprintf(
    95101                '<div class="%1$s">%2$s</div>',
    96                 $image_classes,
     102                esc_attr( $image_classes ),
    97103                $featured_image
    98104            );
    99105        }
    100106
    101         $title = get_the_title( $post );
    102         if ( ! $title ) {
    103             $title = __( '(no title)' );
    104         }
    105107        $list_items_markup .= sprintf(
    106             '<a href="%1$s">%2$s</a>',
    107             $post_link,
     108            '<a class="wp-block-latest-posts__post-title" href="%1$s">%2$s</a>',
     109            esc_url( $post_link ),
    108110            $title
    109111        );
     
    118120                $list_items_markup .= sprintf(
    119121                    '<div class="wp-block-latest-posts__post-author">%1$s</div>',
    120                     esc_html( $byline )
     122                    $byline
    121123                );
    122124            }
     
    127129                '<time datetime="%1$s" class="wp-block-latest-posts__post-date">%2$s</time>',
    128130                esc_attr( get_the_date( 'c', $post ) ),
    129                 esc_html( get_the_date( '', $post ) )
     131                get_the_date( '', $post )
    130132            );
    131133        }
     
    149151            && isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) {
    150152
    151             $post_content = wp_kses_post( html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset' ) ) );
     153            $post_content = html_entity_decode( $post->post_content, ENT_QUOTES, get_option( 'blog_charset' ) );
    152154
    153155            if ( post_password_required( $post ) ) {
     
    157159            $list_items_markup .= sprintf(
    158160                '<div class="wp-block-latest-posts__post-full-content">%1$s</div>',
    159                 $post_content
     161                wp_kses_post( $post_content )
    160162            );
    161163        }
Note: See TracChangeset for help on using the changeset viewer.