Skip to content

Commit bdf52d3

Browse files
Block editor: Conditionally enqueue front end assets for fitText.
This commit backports to core the php changes required for the fitText implementation which was worked on at WordPress/gutenberg#71904. It can be merged even before the packages are updated because unless the fitText support is used nothing happens.
1 parent 2077aa2 commit bdf52d3

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/wp-includes/block-supports/typography.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,9 @@ function wp_typography_get_preset_inline_style_value( $style_value, $css_propert
306306
* @return string Filtered block content.
307307
*/
308308
function wp_render_typography_support( $block_content, $block ) {
309+
if ( ! empty( $block['attrs']['fitText'] ) ) {
310+
wp_enqueue_script_module( '@wordpress/block-editor/utils/fit-text-frontend' );
311+
}
309312
if ( ! isset( $block['attrs']['style']['typography']['fontSize'] ) ) {
310313
return $block_content;
311314
}

0 commit comments

Comments
 (0)