Filter hook 'rss_widget_feed_link'

in WP Core File wp-includes/widgets/class-wp-widget-rss.php at line 111

View Source

rss_widget_feed_link

Filter Hook
Description
Filters the classic RSS widget's feed icon link. Themes can remove the icon link by using `add_filter( 'rss_widget_feed_link', '__return_empty_string' );`.

Hook Information

File Location wp-includes/widgets/class-wp-widget-rss.php View on GitHub
Hook Type Filter
Line Number 111

Hook Parameters

Type Name Description
string|false $feed_link HTML for link to RSS feed.
array $instance Array of settings for the current widget.

Usage Examples

Basic Usage
<?php
// Hook into rss_widget_feed_link
add_filter('rss_widget_feed_link', 'my_custom_filter', 10, 2);

function my_custom_filter($feed_link, $instance) {
    // Your custom filtering logic here
    return $feed_link;
}

Source Code Context

wp-includes/widgets/class-wp-widget-rss.php:111 - How this hook is used in WordPress core
<?php
 106  			 * @since 5.9.0
 107  			 *
 108  			 * @param string|false $feed_link HTML for link to RSS feed.
 109  			 * @param array        $instance  Array of settings for the current widget.
 110  			 */
 111  			$feed_link = apply_filters( 'rss_widget_feed_link', $feed_link, $instance );
 112  
 113  			$title = $feed_link . '<a class="rsswidget rss-widget-title" href="' . esc_url( $link ) . '">' . esc_html( $title ) . '</a>';
 114  		}
 115  
 116  		echo $args['before_widget'];

PHP Documentation

<?php
/**
			 * Filters the classic RSS widget's feed icon link.
			 *
			 * Themes can remove the icon link by using `add_filter( 'rss_widget_feed_link', '__return_empty_string' );`.
			 *
			 * @since 5.9.0
			 *
			 * @param string|false $feed_link HTML for link to RSS feed.
			 * @param array        $instance  Array of settings for the current widget.
			 */
Quick Info
  • Hook Type: Filter
  • Parameters: 2
  • File: wp-includes/widgets/class-wp-widget-rss.php
Related Hooks

Related hooks will be displayed here in future updates.