wpseek.com
A WordPress-centric search engine for devs and theme authors
wp_register_typography_support is private and should not be used in themes or plugins directly.
wp_register_typography_support › WordPress Function
Sincen/a
Deprecatedn/a
› wp_register_typography_support ( $block_type )
Access: |
|
Parameters: |
|
Defined at: | |
Codex: |
Registers the style and typography block attributes for block types that support it.
Source
function wp_register_typography_support( $block_type ) { $has_font_size_support = false; if ( property_exists( $block_type, 'supports' ) ) { $has_font_size_support = _wp_array_get( $block_type->supports, array( '__experimentalFontSize' ), false ); } $has_line_height_support = false; if ( property_exists( $block_type, 'supports' ) ) { $has_line_height_support = _wp_array_get( $block_type->supports, array( '__experimentalLineHeight' ), false ); } if ( ! $block_type->attributes ) { $block_type->attributes = array(); } if ( ( $has_font_size_support || $has_line_height_support ) && ! array_key_exists( 'style', $block_type->attributes ) ) { $block_type->attributes['style'] = array( 'type' => 'object', ); } if ( $has_font_size_support && ! array_key_exists( 'fontSize', $block_type->attributes ) ) { $block_type->attributes['fontSize'] = array( 'type' => 'string', ); } }