Make WordPress Core


Ignore:
Timestamp:
03/01/2022 04:05:14 PM (3 years ago)
Author:
SergeyBiryukov
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/theme/support.php

    r52798 r52812  
    169169
    170170    /**
     171     * @ticket 55219
     172     */
     173    public function test_plugin_hook_with_no_args() {
     174        add_theme_support( 'foobar' );
     175
     176        add_filter( 'current_theme_supports-foobar', '__return_false' );
     177
     178        $this->assertFalse( current_theme_supports( 'foobar' ) );
     179    }
     180
     181    /**
    171182     * @ticket 26900
    172183     */
Note: See TracChangeset for help on using the changeset viewer.