Changeset 53157 for trunk/src/wp-includes/blocks/rss.php
- Timestamp:
- 04/12/2022 03:10:30 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks/rss.php
r49226 r53157 14 14 */ 15 15 function render_block_core_rss( $attributes ) { 16 if ( in_array( untrailingslashit( $attributes['feedURL'] ), array( site_url(), home_url() ), true ) ) { 17 return '<div class="components-placeholder"><div class="notice notice-error">' . __( 'Adding an RSS feed to this site’s homepage is not supported, as it could lead to a loop that slows down your site. Try using another block, like the <strong>Latest Posts</strong> block, to list posts from the site.' ) . '</div></div>'; 18 } 19 16 20 $rss = fetch_feed( $attributes['feedURL'] ); 17 21 … … 84 88 $classnames[] = 'is-grid'; 85 89 } 86 87 90 if ( isset( $attributes['columns'] ) && 'grid' === $attributes['blockLayout'] ) { 88 91 $classnames[] = 'columns-' . $attributes['columns']; 89 92 } 93 if ( $attributes['displayDate'] ) { 94 $classnames[] = 'has-dates'; 95 } 96 if ( $attributes['displayAuthor'] ) { 97 $classnames[] = 'has-authors'; 98 } 99 if ( $attributes['displayExcerpt'] ) { 100 $classnames[] = 'has-excerpts'; 101 } 102 90 103 $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => implode( ' ', $classnames ) ) ); 91 104
Note: See TracChangeset
for help on using the changeset viewer.