[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)





/wp-includes/block-supports/ -> typography.php (summary)

Typography block support flag.

File Size: 586 lines (22 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 7 functions


Functions that are not part of a class:

wp_register_typography_support( $block_type )   X-Ref
Registers the style and typography block attributes for block types that support it.

param: WP_Block_Type $block_type Block Type.

wp_apply_typography_support( $block_type, $block_attributes )   X-Ref
Adds CSS classes and inline styles for typography features such as font sizes
to the incoming attributes array. This will be applied to the block markup in
the front-end.

return: array Typography CSS classes and inline styles.
param: WP_Block_Type $block_type       Block type.
param: array         $block_attributes Block attributes.

wp_typography_get_preset_inline_style_value( $style_value, $css_property )   X-Ref
Generates an inline style value for a typography feature e.g. text decoration,
text transform, and font style.

Note: This function is for backwards compatibility.
* It is necessary to parse older blocks whose typography styles contain presets.
* It mostly replaces the deprecated `wp_typography_get_css_variable_inline_style()`,
but skips compiling a CSS declaration as the style engine takes over this role.
return: string A CSS inline style value.
param: string $style_value  A raw style value for a single typography feature from a block's style attribute.
param: string $css_property Slug for the CSS property the inline style sets.

wp_render_typography_support( $block_content, $block )   X-Ref
Renders typography styles/content to the block wrapper.

return: string Filtered block content.
param: string $block_content Rendered block content.
param: array  $block         Block object.

wp_get_typography_value_and_unit( $raw_value, $options = array()   X-Ref
Checks a string for a unit and value and returns an array
consisting of `'value'` and `'unit'`, e.g. array( '42', 'rem' ).

return: array|null An array consisting of `'value'` and `'unit'` properties on success.
param: string|int|float $raw_value Raw size value from theme.json.
param: array            $options   {

wp_get_computed_fluid_typography_value( $args = array()   X-Ref
Internal implementation of CSS clamp() based on available min/max viewport
width and min/max font sizes.

return: string|null A font-size value using clamp() on success, otherwise null.
param: array $args {

wp_get_typography_font_size_value( $preset, $should_use_fluid_typography = false )   X-Ref
Returns a font-size value based on a given font-size preset.
Takes into account fluid typography parameters and attempts to return a CSS
formula depending on available, valid values.

return: string|null Font-size value or null if a size is not passed in $preset.
param: array $preset                     {
param: bool  $should_use_fluid_typography An override to switch fluid typography "on". Can be used for unit testing.

Generated : Fri Dec 2 08:20:02 2022 Cross-referenced by PHPXref