Make WordPress Core

Changeset 57260


Ignore:
Timestamp:
01/10/2024 12:25:19 AM (5 months ago)
Author:
isabel_brison
Message:

Editor: Allow default duotone styles if not explicitly disabled in theme.json.

Removes setting that disabled default duotone palette from being output in themes without theme.json.

Props andrewserong.
Fixes #60136.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-theme-json-resolver.php

    r57255 r57260  
    312312            }
    313313            $theme_support_data['settings']['color']['defaultGradients'] = $default_gradients;
    314 
    315             // Classic themes without a theme.json don't support global duotone.
    316             $theme_support_data['settings']['color']['defaultDuotone'] = false;
    317314
    318315            // Allow themes to enable link color setting via theme_support.
  • trunk/tests/phpunit/tests/theme/wpThemeJsonResolver.php

    r57255 r57260  
    471471        $this->assertSame( $color_palette, $settings['color']['palette']['theme'] );
    472472        $this->assertTrue( $settings['border']['color'], 'Support for "appearance-tools" was not added.' );
     473    }
     474
     475    /**
     476     * Tests that classic themes still get core default settings such as color palette and duotone.
     477     *
     478     * @ticket 60136
     479     */
     480    public function test_core_default_settings_are_loaded_for_themes_without_theme_json() {
     481        switch_theme( 'default' );
     482
     483        $settings = WP_Theme_JSON_Resolver::get_merged_data( 'theme' )->get_settings();
     484
     485        $this->assertFalse( wp_theme_has_theme_json() );
     486        $this->assertTrue( $settings['color']['defaultPalette'] );
     487        $this->assertTrue( $settings['color']['defaultDuotone'] );
     488        $this->assertTrue( $settings['color']['defaultGradients'] );
    473489    }
    474490
Note: See TracChangeset for help on using the changeset viewer.