@@ -65,40 +65,14 @@ public static function get_theme_data( $deprecated = array(), $settings = array(
65
65
if ( ! $ settings ['with_supports ' ] ) {
66
66
return static ::$ theme ;
67
67
}
68
-
69
- $ editor_settings = array (
70
- 'disableCustomColors ' => get_theme_support ( 'disable-custom-colors ' ),
71
- 'disableCustomFontSizes ' => get_theme_support ( 'disable-custom-font-sizes ' ),
72
- 'disableCustomGradients ' => get_theme_support ( 'disable-custom-gradients ' ),
73
- 'disableLayoutStyles ' => get_theme_support ( 'disable-layout-styles ' ),
74
- 'enableCustomLineHeight ' => get_theme_support ( 'custom-line-height ' ),
75
- 'enableCustomSpacing ' => get_theme_support ( 'custom-spacing ' ),
76
- 'enableCustomUnits ' => get_theme_support ( 'custom-units ' ),
77
- );
78
-
79
- // Theme settings.
80
- $ color_palette = current ( (array ) get_theme_support ( 'editor-color-palette ' ) );
81
- if ( false !== $ color_palette ) {
82
- $ editor_settings ['colors ' ] = $ color_palette ;
83
- }
84
-
85
- $ font_sizes = current ( (array ) get_theme_support ( 'editor-font-sizes ' ) );
86
- if ( false !== $ font_sizes ) {
87
- $ editor_settings ['fontSizes ' ] = $ font_sizes ;
88
- }
89
-
90
- $ gradient_presets = current ( (array ) get_theme_support ( 'editor-gradient-presets ' ) );
91
- if ( false !== $ gradient_presets ) {
92
- $ editor_settings ['gradients ' ] = $ gradient_presets ;
93
- }
94
68
95
69
/*
96
70
* We want the presets and settings declared in theme.json
97
71
* to override the ones declared via theme supports.
98
72
* So we take theme supports, transform it to theme.json shape
99
73
* and merge the static::$theme upon that.
100
74
*/
101
- $ theme_support_data = WP_Theme_JSON_Gutenberg::get_from_editor_settings ( $ editor_settings );
75
+ $ theme_support_data = WP_Theme_JSON_Gutenberg::get_from_editor_settings ( gutenberg_get_block_theme_supports () );
102
76
if ( ! wp_theme_has_theme_json () ) {
103
77
if ( ! isset ( $ theme_support_data ['settings ' ]['color ' ] ) ) {
104
78
$ theme_support_data ['settings ' ]['color ' ] = array ();
0 commit comments