Make WordPress Core

Changeset 61115


Ignore:
Timestamp:
11/03/2025 07:46:11 PM (6 weeks ago)
Author:
jorgefilipecosta
Message:

Block editor: Don't load fit text frontend scripts on the editor.

This commit fixes an issue where the FitText frontend script (fit-text-frontend.js) was incorrectly being enqueued and loaded in the block editor when editing posts that contain blocks with the fitText attribute enabled. It had no big impact has the script does not do anything on the editor (the classes the script searches are not there) but still it's useless bytes we are sending.

Developed in #10437.

Props jorgefilipecosta, oandregal.
Fixes #64173.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/block-supports/typography.php

    r61015 r61115  
    307307 */
    308308function wp_render_typography_support( $block_content, $block ) {
    309     if ( ! empty( $block['attrs']['fitText'] ) ) {
     309    if ( ! empty( $block['attrs']['fitText'] ) && ! is_admin() ) {
    310310        wp_enqueue_script_module( '@wordpress/block-editor/utils/fit-text-frontend' );
    311311    }
Note: See TracChangeset for help on using the changeset viewer.