Make WordPress Core


Ignore:
Timestamp:
01/14/2023 09:34:55 AM (21 months ago)
Author:
audrasjb
Message:

Themes: Add opt-in Appearance Tools support for Classic Themes.

This changeset merges the following changes from Gutenberg repository:

  • Allow themes without theme.json to opt-in to appearance tools via add_theme_support( 'appearance-tools' );
  • Update wpThemeJsonResolver unit tests accordingly

See the following pull request for more info: https://github.com/WordPress/gutenberg/pull/43337

Props ironprogrammer, audrasjb.
Fixes #57460.

File:
1 edited

Legend:

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

    r54896 r55067  
    450450    /**
    451451     * @ticket 54336
     452     * @ticket 56467
     453     *
     454     * @covers ::add_theme_support
    452455     */
    453456    public function test_add_theme_supports_are_loaded_for_themes_without_theme_json() {
     
    472475        add_theme_support( 'editor-color-palette', $color_palette );
    473476        add_theme_support( 'custom-line-height' );
     477        add_theme_support( 'appearance-tools' );
    474478
    475479        $settings = WP_Theme_JSON_Resolver::get_theme_data()->get_settings();
     
    477481        remove_theme_support( 'custom-line-height' );
    478482        remove_theme_support( 'editor-color-palette' );
     483        remove_theme_support( 'appearance-tools' );
    479484
    480485        $this->assertFalse( WP_Theme_JSON_Resolver::theme_has_support() );
    481486        $this->assertTrue( $settings['typography']['lineHeight'] );
    482487        $this->assertSame( $color_palette, $settings['color']['palette']['theme'] );
     488        $this->assertTrue( $settings['border']['color'], 'Support for appearance-tools was not added.' );
    483489    }
    484490
Note: See TracChangeset for help on using the changeset viewer.