Changeset 53157 for trunk/src/wp-includes/blocks/latest-posts.php
- Timestamp:
- 04/12/2022 03:10:30 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/latest-posts.php
r50761 r53157 61 61 foreach ( $recent_posts as $post ) { 62 62 $post_link = esc_url( get_permalink( $post ) ); 63 $title = get_the_title( $post ); 64 65 if ( ! $title ) { 66 $title = __( '(no title)' ); 67 } 63 68 64 69 $list_items_markup .= '<li>'; … … 82 87 $attributes['featuredImageSizeSlug'], 83 88 array( 84 'style' => $image_style,89 'style' => esc_attr( $image_style ), 85 90 ) 86 91 ); 87 92 if ( $attributes['addLinkToFeaturedImage'] ) { 88 93 $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 ), 91 97 $featured_image 92 98 ); … … 94 100 $list_items_markup .= sprintf( 95 101 '<div class="%1$s">%2$s</div>', 96 $image_classes,102 esc_attr( $image_classes ), 97 103 $featured_image 98 104 ); 99 105 } 100 106 101 $title = get_the_title( $post );102 if ( ! $title ) {103 $title = __( '(no title)' );104 }105 107 $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 ), 108 110 $title 109 111 ); … … 118 120 $list_items_markup .= sprintf( 119 121 '<div class="wp-block-latest-posts__post-author">%1$s</div>', 120 esc_html( $byline )122 $byline 121 123 ); 122 124 } … … 127 129 '<time datetime="%1$s" class="wp-block-latest-posts__post-date">%2$s</time>', 128 130 esc_attr( get_the_date( 'c', $post ) ), 129 esc_html( get_the_date( '', $post ))131 get_the_date( '', $post ) 130 132 ); 131 133 } … … 149 151 && isset( $attributes['displayPostContentRadio'] ) && 'full_post' === $attributes['displayPostContentRadio'] ) { 150 152 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' ) ); 152 154 153 155 if ( post_password_required( $post ) ) { … … 157 159 $list_items_markup .= sprintf( 158 160 '<div class="wp-block-latest-posts__post-full-content">%1$s</div>', 159 $post_content161 wp_kses_post( $post_content ) 160 162 ); 161 163 }
Note: See TracChangeset
for help on using the changeset viewer.