Skip to content

How to disable the Stretchy Text options (fitText) ? #73770

@skorasaurus

Description

@skorasaurus

What problem does this address?

Hi,
I appreciate the continued development of Gutenberg and WordPress and offering new features in the editor, I'd like to disable the FitText option for our content editors at this time.

What is your proposed solution?

A canonical method to disable editors from using the fitText option in blocks.

Using the block_type_metadata filter in PHP, I can disable support but that does not remove the variations from appearing in the block's transforms windows.

function remove_fitText_variation( $metadata ) {
	$teh_array = ['core/paragraph', 'core/heading'];
    if ( in_array($metadata['name'], $teh_array, true )) {
        $metadata['supports']['typography']['fitText'] = false;
    }
    return $metadata;
}
add_filter( 'block_type_metadata', 'remove_fitText_variation' );

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions