Changeset 61145
- Timestamp:
- 11/06/2025 06:22:27 PM (5 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/block-supports/typography.php
r61115 r61145 309 309 if ( ! empty( $block['attrs']['fitText'] ) && ! is_admin() ) { 310 310 wp_enqueue_script_module( '@wordpress/block-editor/utils/fit-text-frontend' ); 311 312 // Add Interactivity API directives for fit text to work with client-side navigation. 313 if ( ! empty( $block_content ) ) { 314 $processor = new WP_HTML_Tag_Processor( $block_content ); 315 if ( $processor->next_tag() ) { 316 if ( ! $processor->get_attribute( 'data-wp-interactive' ) ) { 317 $processor->set_attribute( 'data-wp-interactive', true ); 318 } 319 $processor->set_attribute( 'data-wp-context---core-fit-text', 'core/fit-text::{"fontSize":""}' ); 320 $processor->set_attribute( 'data-wp-init---core-fit-text', 'core/fit-text::callbacks.init' ); 321 $processor->set_attribute( 'data-wp-style--font-size', 'core/fit-text::context.fontSize' ); 322 $block_content = $processor->get_updated_html(); 323 } 324 } 311 325 } 312 326 if ( ! isset( $block['attrs']['style']['typography']['fontSize'] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.