Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow default duotone styles in themes that don't disable them. #5817

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading