WordPress.org

Make WordPress Core

Ticket #52224: 52224.filter.diff

File 52224.filter.diff, 1.6 KB (added by sabernhardt, 7 months ago)

adding: filter, unique classes, internationalization, lazy loading

  • src/wp-includes/widgets/class-wp-widget-rss.php

     
    8484                /** This filter is documented in wp-includes/widgets/class-wp-widget-pages.php */
    8585                $title = apply_filters( 'widget_title', $title, $instance, $this->id_base );
    8686
    87                 $url  = strip_tags( $url );
    88                 $icon = includes_url( 'images/rss.png' );
    8987                if ( $title ) {
    90                         $title = '<a class="rsswidget" href="' . esc_url( $url ) . '"><img class="rss-widget-icon" style="border:0" width="14" height="14" src="' . esc_url( $icon ) . '" alt="RSS" /></a> <a class="rsswidget" href="' . esc_url( $link ) . '">' . esc_html( $title ) . '</a>';
     88                        $feed_url  = strip_tags( $url );
     89                        $feed_icon = includes_url( 'images/rss.png' );
     90                        $feed_link = '<a class="rsswidget rss-widget-feed" href="' . esc_url( $feed_url ) . '"><img class="rss-widget-icon" style="border:0" width="14" height="14" src="' . esc_url( $feed_icon ) . '" alt="' . esc_attr__( 'RSS' ) . '" loading="lazy" /></a> ';
     91
     92                        /**
     93                         * Filters the RSS widget feed icon link.
     94                         *
     95                         * @since 5.7.0
     96                         *
     97                         * @param string $feed_link HTML for link to RSS feed.
     98                         * @param array  $instance  Array of settings for the current widget.
     99                         */
     100                        $feed_link = apply_filters( 'rss_widget_feed_link', $feed_link, $instance );
     101
     102                        $title = $feed_link . '<a class="rsswidget rss-widget-title" href="' . esc_url( $link ) . '">' . esc_html( $title ) . '</a>';
    91103                }
    92104
    93105                echo $args['before_widget'];