@@ -29,6 +29,7 @@ function gutenberg_register_typography_support( $block_type ) {
29
29
$ has_text_columns_support = _wp_array_get ( $ typography_supports , array ( 'textColumns ' ), false );
30
30
$ has_text_decoration_support = _wp_array_get ( $ typography_supports , array ( '__experimentalTextDecoration ' ), false );
31
31
$ has_text_transform_support = _wp_array_get ( $ typography_supports , array ( '__experimentalTextTransform ' ), false );
32
+ $ has_writing_mode_support = _wp_array_get ( $ typography_supports , array ( '__experimentalWritingMode ' ), false );
32
33
33
34
$ has_typography_support = $ has_font_family_support
34
35
|| $ has_font_size_support
@@ -38,7 +39,8 @@ function gutenberg_register_typography_support( $block_type ) {
38
39
|| $ has_line_height_support
39
40
|| $ has_text_columns_support
40
41
|| $ has_text_decoration_support
41
- || $ has_text_transform_support ;
42
+ || $ has_text_transform_support
43
+ || $ has_writing_mode_support ;
42
44
43
45
if ( ! $ block_type ->attributes ) {
44
46
$ block_type ->attributes = array ();
@@ -96,6 +98,7 @@ function gutenberg_apply_typography_support( $block_type, $block_attributes ) {
96
98
$ has_text_columns_support = _wp_array_get ( $ typography_supports , array ( 'textColumns ' ), false );
97
99
$ has_text_decoration_support = _wp_array_get ( $ typography_supports , array ( '__experimentalTextDecoration ' ), false );
98
100
$ has_text_transform_support = _wp_array_get ( $ typography_supports , array ( '__experimentalTextTransform ' ), false );
101
+ $ has_writing_mode_support = _wp_array_get ( $ typography_supports , array ( '__experimentalWritingMode ' ), false );
99
102
100
103
// Whether to skip individual block support features.
101
104
$ should_skip_font_size = wp_should_skip_block_supports_serialization ( $ block_type , 'typography ' , 'fontSize ' );
@@ -107,6 +110,7 @@ function gutenberg_apply_typography_support( $block_type, $block_attributes ) {
107
110
$ should_skip_text_decoration = wp_should_skip_block_supports_serialization ( $ block_type , 'typography ' , 'textDecoration ' );
108
111
$ should_skip_text_transform = wp_should_skip_block_supports_serialization ( $ block_type , 'typography ' , 'textTransform ' );
109
112
$ should_skip_letter_spacing = wp_should_skip_block_supports_serialization ( $ block_type , 'typography ' , 'letterSpacing ' );
113
+ $ should_skip_writing_mode = wp_should_skip_block_supports_serialization ( $ block_type , 'typography ' , 'writingMode ' );
110
114
111
115
$ typography_block_styles = array ();
112
116
if ( $ has_font_size_support && ! $ should_skip_font_size ) {
@@ -158,6 +162,10 @@ function gutenberg_apply_typography_support( $block_type, $block_attributes ) {
158
162
gutenberg_typography_get_preset_inline_style_value ( $ block_attributes ['style ' ]['typography ' ]['letterSpacing ' ], 'letter-spacing ' );
159
163
}
160
164
165
+ if ( $ has_writing_mode_support && ! $ should_skip_writing_mode && isset ( $ block_attributes ['style ' ]['typography ' ]['writingMode ' ] ) ) {
166
+ $ typography_block_styles ['writingMode ' ] = _wp_array_get ( $ block_attributes , array ( 'style ' , 'typography ' , 'writingMode ' ), null );
167
+ }
168
+
161
169
$ attributes = array ();
162
170
$ styles = gutenberg_style_engine_get_styles (
163
171
array ( 'typography ' => $ typography_block_styles ),
0 commit comments