From 257b634b921c821745d636cabb4007edbb12bc17 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 1 Mar 2022 16:07:05 +0000 Subject: [PATCH] Themes: Make sure the `current_theme_supports-{$feature}` filter is consistently applied. Previously, the filter was not applied if there are no arguments passed to `current_theme_supports()`. Follow-up to [12350], [19682]. Props helgatheviking, azouamauriac, pavanpatil1, SergeyBiryukov. Fixes #55219. Built from https://develop.svn.wordpress.org/trunk@52812 git-svn-id: http://core.svn.wordpress.org/trunk@52401 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/theme.php | 5 +++-- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/wp-includes/theme.php b/wp-includes/theme.php index f28acc8d15..9effbadcd5 100644 --- a/wp-includes/theme.php +++ b/wp-includes/theme.php @@ -3037,9 +3037,10 @@ function current_theme_supports( $feature, ...$args ) { return false; } - // If no args passed then no extra checks need be performed. + // If no args passed then no extra checks need to be performed. if ( ! $args ) { - return true; + /** This filter is documented in wp-includes/theme.php */ + return apply_filters( "current_theme_supports-{$feature}", true, $args, $_wp_theme_features[ $feature ] ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores } switch ( $feature ) { diff --git a/wp-includes/version.php b/wp-includes/version.php index eb99a17adf..049a9e116d 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.0-alpha-52811'; +$wp_version = '6.0-alpha-52812'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.