Skip to content

Commit 10290dc

Browse files
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. git-svn-id: https://develop.svn.wordpress.org/trunk@61115 602fd350-edb4-49c9-b593-d223f7449a82
1 parent fbef50b commit 10290dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ 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'] ) ) {
309+
if ( ! empty( $block['attrs']['fitText'] ) && ! is_admin() ) {
310310
wp_enqueue_script_module( '@wordpress/block-editor/utils/fit-text-frontend' );
311311
}
312312
if ( ! isset( $block['attrs']['style']['typography']['fontSize'] ) ) {

0 commit comments

Comments
 (0)