[ Index ]

PHP Cross Reference of WordPress Trunk (Updated Daily)

Search

title

Body

[close]

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

Typography block support flag.

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

Defines 7 functions

  wp_register_typography_support()
  wp_apply_typography_support()
  wp_typography_get_preset_inline_style_value()
  wp_render_typography_support()
  wp_get_typography_value_and_unit()
  wp_get_computed_fluid_typography_value()
  wp_get_typography_font_size_value()

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.

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

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.
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.
return: string A CSS inline style value.

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

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

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' ).

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

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.

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

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.

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



Generated : Thu Mar 28 08:20:01 2024 Cross-referenced by PHPXref