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
This commit is contained in:
Sergey Biryukov 2022-03-01 16:07:05 +00:00
parent 4789371cfe
commit 257b634b92
2 changed files with 4 additions and 3 deletions

View File

@ -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 ) {

View File

@ -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.