@@ -54,3 +54,38 @@ function ( $item ) {
54
54
}
55
55
}
56
56
}
57
+
58
+ /**
59
+ * Repeated logic from `get_default_block_editor_settings` function. When implemented into core,
60
+ * remove logic from `get_default_block_editor_settings` and simple call this function instead.
61
+ *
62
+ * @return array
63
+ */
64
+ function gutenberg_get_legacy_theme_supports_for_theme_json () {
65
+ $ theme_settings = array (
66
+ 'disableCustomColors ' => get_theme_support ( 'disable-custom-colors ' ),
67
+ 'disableCustomFontSizes ' => get_theme_support ( 'disable-custom-font-sizes ' ),
68
+ 'disableCustomGradients ' => get_theme_support ( 'disable-custom-gradients ' ),
69
+ 'enableCustomLineHeight ' => get_theme_support ( 'custom-line-height ' ),
70
+ 'enableCustomSpacing ' => get_theme_support ( 'custom-spacing ' ),
71
+ 'enableCustomUnits ' => get_theme_support ( 'custom-units ' ),
72
+ );
73
+
74
+ // Theme settings.
75
+ $ color_palette = current ( (array ) get_theme_support ( 'editor-color-palette ' ) );
76
+ if ( false !== $ color_palette ) {
77
+ $ theme_settings ['colors ' ] = $ color_palette ;
78
+ }
79
+
80
+ $ font_sizes = current ( (array ) get_theme_support ( 'editor-font-sizes ' ) );
81
+ if ( false !== $ font_sizes ) {
82
+ $ theme_settings ['fontSizes ' ] = $ font_sizes ;
83
+ }
84
+
85
+ $ gradient_presets = current ( (array ) get_theme_support ( 'editor-gradient-presets ' ) );
86
+ if ( false !== $ gradient_presets ) {
87
+ $ theme_settings ['gradients ' ] = $ gradient_presets ;
88
+ }
89
+
90
+ return $ theme_settings ;
91
+ }
0 commit comments