diff -r be944660c56a -r 3d72ae0968f4 wp/wp-includes/widgets/class-wp-widget-rss.php
--- a/wp/wp-includes/widgets/class-wp-widget-rss.php Wed Sep 21 18:19:35 2022 +0200
+++ b/wp/wp-includes/widgets/class-wp-widget-rss.php Tue Sep 27 16:37:53 2022 +0200
@@ -86,10 +86,31 @@
/** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
$title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
- $url = strip_tags( $url );
- $icon = includes_url( 'images/rss.png' );
if ( $title ) {
- $title = ' ';
+ $feed_link = '';
+ $feed_url = strip_tags( $url );
+ $feed_icon = includes_url( 'images/rss.png' );
+ $feed_link = sprintf(
+ ' ',
+ esc_url( $feed_url ),
+ esc_url( $feed_icon ),
+ esc_attr__( 'RSS' ),
+ ( wp_lazy_loading_enabled( 'img', 'rss_widget_feed_icon' ) ? ' loading="lazy"' : '' )
+ );
+
+ /**
+ * Filters the classic RSS widget's feed icon link.
+ *
+ * Themes can remove the icon link by using `add_filter( 'rss_widget_feed_link', '__return_false' );`.
+ *
+ * @since 5.9.0
+ *
+ * @param string $feed_link HTML for link to RSS feed.
+ * @param array $instance Array of settings for the current widget.
+ */
+ $feed_link = apply_filters( 'rss_widget_feed_link', $feed_link, $instance );
+
+ $title = $feed_link . '';
}
echo $args['before_widget'];
@@ -106,7 +127,7 @@
// The title may be filtered: Strip out HTML and make sure the aria-label is never empty.
$title = trim( strip_tags( $title ) );
$aria_label = $title ? $title : __( 'RSS Feed' );
- echo '