Changeset 58314 for trunk/src/wp-includes/block-supports/typography.php
- Timestamp:
- 06/04/2024 05:34:12 AM (12 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/typography.php
r58171 r58314 32 32 $has_letter_spacing_support = isset( $typography_supports['__experimentalLetterSpacing'] ) ? $typography_supports['__experimentalLetterSpacing'] : false; 33 33 $has_line_height_support = isset( $typography_supports['lineHeight'] ) ? $typography_supports['lineHeight'] : false; 34 $has_text_align_support = isset( $typography_supports['textAlign'] ) ? $typography_supports['textAlign'] : false; 34 35 $has_text_columns_support = isset( $typography_supports['textColumns'] ) ? $typography_supports['textColumns'] : false; 35 36 $has_text_decoration_support = isset( $typography_supports['__experimentalTextDecoration'] ) ? $typography_supports['__experimentalTextDecoration'] : false; … … 43 44 || $has_letter_spacing_support 44 45 || $has_line_height_support 46 || $has_text_align_support 45 47 || $has_text_columns_support 46 48 || $has_text_decoration_support … … 107 109 $has_letter_spacing_support = isset( $typography_supports['__experimentalLetterSpacing'] ) ? $typography_supports['__experimentalLetterSpacing'] : false; 108 110 $has_line_height_support = isset( $typography_supports['lineHeight'] ) ? $typography_supports['lineHeight'] : false; 111 $has_text_align_support = isset( $typography_supports['textAlign'] ) ? $typography_supports['textAlign'] : false; 109 112 $has_text_columns_support = isset( $typography_supports['textColumns'] ) ? $typography_supports['textColumns'] : false; 110 113 $has_text_decoration_support = isset( $typography_supports['__experimentalTextDecoration'] ) ? $typography_supports['__experimentalTextDecoration'] : false; … … 118 121 $should_skip_font_weight = wp_should_skip_block_supports_serialization( $block_type, 'typography', 'fontWeight' ); 119 122 $should_skip_line_height = wp_should_skip_block_supports_serialization( $block_type, 'typography', 'lineHeight' ); 123 $should_skip_text_align = wp_should_skip_block_supports_serialization( $block_type, 'typography', 'textAlign' ); 120 124 $should_skip_text_columns = wp_should_skip_block_supports_serialization( $block_type, 'typography', 'textColumns' ); 121 125 $should_skip_text_decoration = wp_should_skip_block_supports_serialization( $block_type, 'typography', 'textDecoration' ); … … 177 181 } 178 182 183 if ( $has_text_align_support && ! $should_skip_text_align ) { 184 $typography_block_styles['textAlign'] = isset( $block_attributes['style']['typography']['textAlign'] ) 185 ? $block_attributes['style']['typography']['textAlign'] 186 : null; 187 } 188 179 189 if ( $has_text_columns_support && ! $should_skip_text_columns && isset( $block_attributes['style']['typography']['textColumns'] ) ) { 180 190 $typography_block_styles['textColumns'] = isset( $block_attributes['style']['typography']['textColumns'] ) … … 226 236 227 237 $attributes = array(); 238 $classnames = array(); 228 239 $styles = wp_style_engine_get_styles( 229 240 array( 'typography' => $typography_block_styles ), … … 232 243 233 244 if ( ! empty( $styles['classnames'] ) ) { 234 $attributes['class'] = $styles['classnames']; 245 $classnames[] = $styles['classnames']; 246 } 247 248 if ( $has_text_align_support && ! $should_skip_text_align && isset( $block_attributes['style']['typography']['textAlign'] ) ) { 249 $classnames[] = 'has-text-align-' . $block_attributes['style']['typography']['textAlign']; 250 } 251 252 if ( ! empty( $classnames ) ) { 253 $attributes['class'] = implode( ' ', $classnames ); 235 254 } 236 255
Note: See TracChangeset
for help on using the changeset viewer.