Skip to content

Disable Classic block: Always register, hide from inserter conditionally#77840

Merged
yuliyan merged 1 commit intoWordPress:trunkfrom
yuliyan:update/classic-block-experiment-conditional-inserter-support
May 1, 2026
Merged

Disable Classic block: Always register, hide from inserter conditionally#77840
yuliyan merged 1 commit intoWordPress:trunkfrom
yuliyan:update/classic-block-experiment-conditional-inserter-support

Conversation

@yuliyan
Copy link
Copy Markdown
Contributor

@yuliyan yuliyan commented Apr 30, 2026

What?

Always register the core/freeform (Classic) block. Its inserter availability is now controlled by supports.inserter instead of conditionally skipping registration.

Why?

Trying a different approach for the experiment - instead of skipping registration, we always register the block but hide it from the inserter. This preserves support for existing posts that already contain a Classic block, while preventing new ones from being added.

The exact condition for hiding the block in the inserter will be tweaked in follow-up PRs.

How?

The Classic block is now always included in the list of registered core blocks. When the experiment is enabled, its visibility in the inserter is controlled via supports.inserter based on the window.wp.needsClassicBlock flag.

Testing Instructions

  1. Open a post that does not contain a classic block.
  2. Confirm the Classic block is not in the inserter when the "Disable Classic block" experiment is enabled.
  3. Disable the experiment and confirm the Classic block appears in the inserter.
  4. Open a post that contains a classic block and confirm it still renders/edits correctly in both cases.

Testing Instructions for Keyboard

Screenshots or screencast

N/A

Use of AI Tools

Opus 4.7

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label Apr 30, 2026
@yuliyan yuliyan added the [Type] Experimental Experimental feature or API. label Apr 30, 2026
@yuliyan yuliyan requested a review from tyxla April 30, 2026 13:12
@yuliyan yuliyan marked this pull request as ready for review April 30, 2026 13:12
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: yuliyan <yuliyan@git.wordpress.org>
Co-authored-by: tyxla <tyxla@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@yuliyan yuliyan force-pushed the update/classic-block-experiment-conditional-inserter-support branch from fa5257d to 9e42794 Compare April 30, 2026 13:31
Copy link
Copy Markdown
Member

@tyxla tyxla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected, thanks 👍

@yuliyan yuliyan force-pushed the update/classic-block-experiment-conditional-inserter-support branch from 9e42794 to 599c682 Compare May 1, 2026 08:05
@yuliyan yuliyan merged commit e4a8a34 into WordPress:trunk May 1, 2026
39 checks passed
@github-actions github-actions Bot added this to the Gutenberg 23.2 milestone May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library [Type] Experimental Experimental feature or API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants