Changeset 56709 for trunk/src/wp-includes/block-supports/typography.php
- Timestamp:
- 09/26/2023 01:45:23 PM (22 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/typography.php
r56605 r56709 21 21 } 22 22 23 $typography_supports = _wp_array_get( $block_type->supports, array( 'typography' ), false );23 $typography_supports = isset( $block_type->supports['typography'] ) ? $block_type->supports['typography'] : false; 24 24 if ( ! $typography_supports ) { 25 25 return; 26 26 } 27 27 28 $has_font_family_support = _wp_array_get( $typography_supports, array( '__experimentalFontFamily' ), false );29 $has_font_size_support = _wp_array_get( $typography_supports, array( 'fontSize' ), false );30 $has_font_style_support = _wp_array_get( $typography_supports, array( '__experimentalFontStyle' ), false );31 $has_font_weight_support = _wp_array_get( $typography_supports, array( '__experimentalFontWeight' ), false );32 $has_letter_spacing_support = _wp_array_get( $typography_supports, array( '__experimentalLetterSpacing' ), false );33 $has_line_height_support = _wp_array_get( $typography_supports, array( 'lineHeight' ), false );34 $has_text_columns_support = _wp_array_get( $typography_supports, array( 'textColumns' ), false );35 $has_text_decoration_support = _wp_array_get( $typography_supports, array( '__experimentalTextDecoration' ), false );36 $has_text_transform_support = _wp_array_get( $typography_supports, array( '__experimentalTextTransform' ), false );37 $has_writing_mode_support = _wp_array_get( $typography_supports, array( '__experimentalWritingMode' ), false );28 $has_font_family_support = isset( $typography_supports['__experimentalFontFamily'] ) ? $typography_supports['__experimentalFontFamily'] : false; 29 $has_font_size_support = isset( $typography_supports['fontSize'] ) ? $typography_supports['fontSize'] : false; 30 $has_font_style_support = isset( $typography_supports['__experimentalFontStyle'] ) ? $typography_supports['__experimentalFontStyle'] : false; 31 $has_font_weight_support = isset( $typography_supports['__experimentalFontWeight'] ) ? $typography_supports['__experimentalFontWeight'] : false; 32 $has_letter_spacing_support = isset( $typography_supports['__experimentalLetterSpacing'] ) ? $typography_supports['__experimentalLetterSpacing'] : false; 33 $has_line_height_support = isset( $typography_supports['lineHeight'] ) ? $typography_supports['lineHeight'] : false; 34 $has_text_columns_support = isset( $typography_supports['textColumns'] ) ? $typography_supports['textColumns'] : false; 35 $has_text_decoration_support = isset( $typography_supports['__experimentalTextDecoration'] ) ? $typography_supports['__experimentalTextDecoration'] : false; 36 $has_text_transform_support = isset( $typography_supports['__experimentalTextTransform'] ) ? $typography_supports['__experimentalTextTransform'] : false; 37 $has_writing_mode_support = isset( $typography_supports['__experimentalWritingMode'] ) ? $typography_supports['__experimentalWritingMode'] : false; 38 38 39 39 $has_typography_support = $has_font_family_support … … 90 90 } 91 91 92 $typography_supports = _wp_array_get( $block_type->supports, array( 'typography' ), false ); 92 $typography_supports = isset( $block_type->supports['typography'] ) 93 ? $block_type->supports['typography'] 94 : false; 93 95 if ( ! $typography_supports ) { 94 96 return array(); … … 99 101 } 100 102 101 $has_font_family_support = _wp_array_get( $typography_supports, array( '__experimentalFontFamily' ), false );102 $has_font_size_support = _wp_array_get( $typography_supports, array( 'fontSize' ), false );103 $has_font_style_support = _wp_array_get( $typography_supports, array( '__experimentalFontStyle' ), false );104 $has_font_weight_support = _wp_array_get( $typography_supports, array( '__experimentalFontWeight' ), false );105 $has_letter_spacing_support = _wp_array_get( $typography_supports, array( '__experimentalLetterSpacing' ), false );106 $has_line_height_support = _wp_array_get( $typography_supports, array( 'lineHeight' ), false );107 $has_text_columns_support = _wp_array_get( $typography_supports, array( 'textColumns' ), false );108 $has_text_decoration_support = _wp_array_get( $typography_supports, array( '__experimentalTextDecoration' ), false );109 $has_text_transform_support = _wp_array_get( $typography_supports, array( '__experimentalTextTransform' ), false );110 $has_writing_mode_support = _wp_array_get( $typography_supports, array( '__experimentalWritingMode' ), false );103 $has_font_family_support = isset( $typography_supports['__experimentalFontFamily'] ) ? $typography_supports['__experimentalFontFamily'] : false; 104 $has_font_size_support = isset( $typography_supports['fontSize'] ) ? $typography_supports['fontSize'] : false; 105 $has_font_style_support = isset( $typography_supports['__experimentalFontStyle'] ) ? $typography_supports['__experimentalFontStyle'] : false; 106 $has_font_weight_support = isset( $typography_supports['__experimentalFontWeight'] ) ? $typography_supports['__experimentalFontWeight'] : false; 107 $has_letter_spacing_support = isset( $typography_supports['__experimentalLetterSpacing'] ) ? $typography_supports['__experimentalLetterSpacing'] : false; 108 $has_line_height_support = isset( $typography_supports['lineHeight'] ) ? $typography_supports['lineHeight'] : false; 109 $has_text_columns_support = isset( $typography_supports['textColumns'] ) ? $typography_supports['textColumns'] : false; 110 $has_text_decoration_support = isset( $typography_supports['__experimentalTextDecoration'] ) ? $typography_supports['__experimentalTextDecoration'] : false; 111 $has_text_transform_support = isset( $typography_supports['__experimentalTextTransform'] ) ? $typography_supports['__experimentalTextTransform'] : false; 112 $has_writing_mode_support = isset( $typography_supports['__experimentalWritingMode'] ) ? $typography_supports['__experimentalWritingMode'] : false; 111 113 112 114 // Whether to skip individual block support features. … … 170 172 171 173 if ( $has_line_height_support && ! $should_skip_line_height ) { 172 $typography_block_styles['lineHeight'] = _wp_array_get( $block_attributes, array( 'style', 'typography', 'lineHeight' ) ); 174 $typography_block_styles['lineHeight'] = isset( $block_attributes['style']['typography']['lineHeight'] ) 175 ? $block_attributes['style']['typography']['lineHeight'] 176 : null; 173 177 } 174 178 175 179 if ( $has_text_columns_support && ! $should_skip_text_columns && isset( $block_attributes['style']['typography']['textColumns'] ) ) { 176 $typography_block_styles['textColumns'] = _wp_array_get( $block_attributes, array( 'style', 'typography', 'textColumns' ), null ); 180 $typography_block_styles['textColumns'] = isset( $block_attributes['style']['typography']['textColumns'] ) 181 ? $block_attributes['style']['typography']['textColumns'] 182 : null; 177 183 } 178 184 … … 214 220 isset( $block_attributes['style']['typography']['writingMode'] ) 215 221 ) { 216 $typography_block_styles['writingMode'] = _wp_array_get( 217 $block_attributes, 218 array( 'style', 'typography', 'writingMode' ), 219 null 220 ); 222 $typography_block_styles['writingMode'] = isset( $block_attributes['style']['typography']['writingMode'] ) 223 ? $block_attributes['style']['typography']['writingMode'] 224 : null; 221 225 } 222 226
Note: See TracChangeset
for help on using the changeset viewer.