From 0f98f3142c122674100d0b963ec9dc154739a120 Mon Sep 17 00:00:00 2001 From: joedolson Date: Wed, 22 Feb 2023 22:02:23 +0000 Subject: [PATCH] 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. Built from https://develop.svn.wordpress.org/trunk@55409 git-svn-id: http://core.svn.wordpress.org/trunk@54942 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-content/themes/twentytwentyone/functions.php | 2 +- wp-includes/version.php | 2 +- wp-includes/widgets/class-wp-widget-rss.php | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-content/themes/twentytwentyone/functions.php b/wp-content/themes/twentytwentyone/functions.php index 73eefb9518..ffbae09ad8 100644 --- a/wp-content/themes/twentytwentyone/functions.php +++ b/wp-content/themes/twentytwentyone/functions.php @@ -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' ); diff --git a/wp-includes/version.php b/wp-includes/version.php index a82ea2b569..892b727974 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.2-beta3-55408'; +$wp_version = '6.2-beta3-55409'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets/class-wp-widget-rss.php b/wp-includes/widgets/class-wp-widget-rss.php index a265680901..a4a1b198b9 100644 --- a/wp-includes/widgets/class-wp-widget-rss.php +++ b/wp-includes/widgets/class-wp-widget-rss.php @@ -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 );