Changeset 49135 for trunk/src/wp-includes/blocks/latest-posts.php
- Timestamp:
- 10/13/2020 01:07:23 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/latest-posts.php
r48177 r49135 59 59 60 60 foreach ( $recent_posts as $post ) { 61 $post_link = esc_url( get_permalink( $post ) ); 61 62 62 63 $list_items_markup .= '<li>'; … … 76 77 } 77 78 79 $featured_image = get_the_post_thumbnail( 80 $post, 81 $attributes['featuredImageSizeSlug'], 82 array( 83 'style' => $image_style, 84 ) 85 ); 86 if ( $attributes['addLinkToFeaturedImage'] ) { 87 $featured_image = sprintf( 88 '<a href="%1$s">%2$s</a>', 89 $post_link, 90 $featured_image 91 ); 92 } 78 93 $list_items_markup .= sprintf( 79 94 '<div class="%1$s">%2$s</div>', 80 95 $image_classes, 81 get_the_post_thumbnail( 82 $post, 83 $attributes['featuredImageSizeSlug'], 84 array( 85 'style' => $image_style, 86 ) 87 ) 96 $featured_image 88 97 ); 89 98 } … … 95 104 $list_items_markup .= sprintf( 96 105 '<a href="%1$s">%2$s</a>', 97 esc_url( get_permalink( $post ) ),106 $post_link, 98 107 $title 99 108 ); … … 145 154 remove_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 ); 146 155 147 $class = 'wp-block-latest-posts wp-block-latest-posts__list'; 148 if ( isset( $attributes['align'] ) ) { 149 $class .= ' align' . $attributes['align']; 150 } 156 $class = 'wp-block-latest-posts__list'; 151 157 152 158 if ( isset( $attributes['postLayout'] ) && 'grid' === $attributes['postLayout'] ) { … … 164 170 if ( isset( $attributes['displayAuthor'] ) && $attributes['displayAuthor'] ) { 165 171 $class .= ' has-author'; 166 }167 168 if ( isset( $attributes['className'] ) ) {169 $class .= ' ' . $attributes['className'];170 172 } 171 173
Note: See TracChangeset
for help on using the changeset viewer.