Skip to content

Commit ca24196

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@57260 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 788d709 commit ca24196

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

src/wp-includes/class-wp-theme-json-resolver.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,6 @@ public static function get_theme_data( $deprecated = array(), $options = array()
312312
}
313313
$theme_support_data['settings']['color']['defaultGradients'] = $default_gradients;
314314

315-
// Classic themes without a theme.json don't support global duotone.
316-
$theme_support_data['settings']['color']['defaultDuotone'] = false;
317-
318315
// Allow themes to enable link color setting via theme_support.
319316
if ( current_theme_supports( 'link-color' ) ) {
320317
$theme_support_data['settings']['color']['link'] = true;

tests/phpunit/tests/theme/wpThemeJsonResolver.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,22 @@ public function test_add_theme_supports_are_loaded_for_themes_without_theme_json
472472
$this->assertTrue( $settings['border']['color'], 'Support for "appearance-tools" was not added.' );
473473
}
474474

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'] );
489+
}
490+
475491
/**
476492
* @ticket 54336
477493
* @ticket 56611

0 commit comments

Comments
 (0)