mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-11 08:04:32 +00:00
Widgets: Match variable types in rss feed link filter.
The `rss_widget_feed_link` filter added in [52031] documents the parameter as a string, but recommends removing by returning false. Change the recommendation and documentation to make this consistent and update Twenty Twenty One to use the new recommended return value. Maintains documentation as possibly returning `false` for backwards compatibility. Props sabernhardt, Mista-Flo. Fixes #57594. git-svn-id: https://develop.svn.wordpress.org/trunk@55409 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -340,7 +340,7 @@ if ( ! function_exists( 'twenty_twenty_one_setup' ) ) {
|
||||
add_theme_support( 'custom-units' );
|
||||
|
||||
// Remove feed icon link from legacy RSS widget.
|
||||
add_filter( 'rss_widget_feed_link', '__return_false' );
|
||||
add_filter( 'rss_widget_feed_link', '__return_empty_string' );
|
||||
}
|
||||
}
|
||||
add_action( 'after_setup_theme', 'twenty_twenty_one_setup' );
|
||||
|
||||
@@ -101,12 +101,12 @@ class WP_Widget_RSS extends WP_Widget {
|
||||
/**
|
||||
* 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' );`.
|
||||
* Themes can remove the icon link by using `add_filter( 'rss_widget_feed_link', '__return_empty_string' );`.
|
||||
*
|
||||
* @since 5.9.0
|
||||
*
|
||||
* @param string $feed_link HTML for link to RSS feed.
|
||||
* @param array $instance Array of settings for the current widget.
|
||||
* @param string|false $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 );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user