Skip to content

Commit

Permalink
Editor: Allow default duotone styles if not explicitly disabled in th…
Browse files Browse the repository at this point in the history
…eme.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
  • Loading branch information
tellthemachines committed Jan 10, 2024
1 parent 788d709 commit ca24196
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/wp-includes/class-wp-theme-json-resolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,6 @@ public static function get_theme_data( $deprecated = array(), $options = array()
}
$theme_support_data['settings']['color']['defaultGradients'] = $default_gradients;

// Classic themes without a theme.json don't support global duotone.
$theme_support_data['settings']['color']['defaultDuotone'] = false;

// Allow themes to enable link color setting via theme_support.
if ( current_theme_supports( 'link-color' ) ) {
$theme_support_data['settings']['color']['link'] = true;
Expand Down
16 changes: 16 additions & 0 deletions tests/phpunit/tests/theme/wpThemeJsonResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,22 @@ public function test_add_theme_supports_are_loaded_for_themes_without_theme_json
$this->assertTrue( $settings['border']['color'], 'Support for "appearance-tools" was not added.' );
}

/**
* Tests that classic themes still get core default settings such as color palette and duotone.
*
* @ticket 60136
*/
public function test_core_default_settings_are_loaded_for_themes_without_theme_json() {
switch_theme( 'default' );

$settings = WP_Theme_JSON_Resolver::get_merged_data( 'theme' )->get_settings();

$this->assertFalse( wp_theme_has_theme_json() );
$this->assertTrue( $settings['color']['defaultPalette'] );
$this->assertTrue( $settings['color']['defaultDuotone'] );
$this->assertTrue( $settings['color']['defaultGradients'] );
}

/**
* @ticket 54336
* @ticket 56611
Expand Down

0 comments on commit ca24196

Please sign in to comment.