Skip to content

No longer able to disable custom font and color styles #32411

@philbuchanan

Description

@philbuchanan

In earlier version of Gutenberg, a developer was able to disable/remove custom font sizes and colors using a few lines of code:

// Disable Gutenberg custom font sizes
add_theme_support('disable-custom-font-sizes');
add_theme_support('editor-font-sizes', array());

// Disable Gutenberg custom colors
add_theme_support('disable-custom-colors');
add_theme_support('editor-color-palette', array());

In recent versions (I'm not 100% sure which version) these settings no longer work. #25756 mentioned the same issue but that was closed despite the issue still remaining.

Expected behaviour

I would expect these settings to continue to be honoured. The documentation even states that these settings should still be honoured.

To retain backward compatibility, the existing add_theme_support declarations that configure the block editor are retrofit in the proper categories for the top-level section. For example, if a theme uses add_theme_support('disable-custom-colors'), it’ll be the same as setting settings.color.custom to false.

Actual behaviour

Even with these settings disabled in functions.php they still show up as:

Screen Shot 2021-06-02 at 3 13 20 PM

WordPress information

  • WordPress version: 5.7.2
  • Gutenberg version: 10.7.1
  • Are all plugins except Gutenberg deactivated? Yes
  • Are you using a default theme (e.g. Twenty Twenty-One)? No

Device information

  • Device: Mac
  • Operating system: macOS 11.4
  • Browser: Safari 14.1.1

Metadata

Metadata

Labels

[Type] BugAn existing feature does not function as intended

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions