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.

git-svn-id: https://develop.svn.wordpress.org/trunk@52812 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2022-03-01 16:05:14 +00:00
parent 44122bf7df
commit f0dfa682a5
2 changed files with 14 additions and 2 deletions

View File

@@ -167,6 +167,17 @@ class Tests_Theme_Support extends WP_UnitTestCase {
$this->assertFalse( current_theme_supports( 'foobar', 'bar' ) );
}
/**
* @ticket 55219
*/
public function test_plugin_hook_with_no_args() {
add_theme_support( 'foobar' );
add_filter( 'current_theme_supports-foobar', '__return_false' );
$this->assertFalse( current_theme_supports( 'foobar' ) );
}
/**
* @ticket 26900
*/