Skip to content

Unregistered block styles appear in the global site editor #58048

@unscripted

Description

@unscripted

Description

After unregistering a block style using unregisterBlockStyle, it remains as a variation that can be customized in the global style editor.

As a developer, I expect that unregistering a default block style should remove it from the global style editor. I view this as an issue because an admin using the global style editor may try to edit something that is not a feature of the theme.

Step-by-step reproduction instructions

  1. Unregister a core block style variation. (I used core/button, outline)
  2. Confirm that it does not appear as a variation in the block editor.
  3. Navigate to the global styles editor > Blocks > Button.
  4. You will see "Outline" as a variation that you can customize.

Screenshots, screen recording, code snippet

Below is the js snipped I used to unregister the block style.

domReady(function () {
  unregisterBlockStyle('core/button', 'outline');
});

Environment info

  • WordPress 6.4.2
  • Gutenberg 17.5.0

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Global StylesAnything related to the broader Global Styles efforts, including Styles Engine and theme.json[Status] DuplicateUsed to indicate that a current issue matches an existing one and can be closed[Type] BugAn existing feature does not function as intended

    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