Skip to content

Editor: Hide Classic Block from inserter#11712

Open
tyxla wants to merge 1 commit intoWordPress:trunkfrom
tyxla:add/classic-block-conditional-visibility
Open

Editor: Hide Classic Block from inserter#11712
tyxla wants to merge 1 commit intoWordPress:trunkfrom
tyxla:add/classic-block-conditional-visibility

Conversation

@tyxla
Copy link
Copy Markdown
Member

@tyxla tyxla commented May 5, 2026

Trac ticket: https://core.trac.wordpress.org/ticket/65166

This PR brings the changes from the following Gutenberg PR to core:

WordPress/gutenberg#77911

Description

We're hiding the Classic block in the block editor inserter by default.

We're also introducing a new wp_classic_block_supports_inserter filter that allows overriding that behavior globally or per post.

See: WordPress/gutenberg#74242

Testing

  • Start writing a new post
  • Verify you don't see the Classic block in the inserter.
  • Open an existing post that contains a classic block (or a <!-- wp:freeform --> block) and confirm the Classic block renders correctly and is editable.
  • Put this in your code: add_filter( 'gutenberg_classic_block_supports_inserter', '__return_true' );. Alternatively, you can use this plugin to test it.
  • Verify you see the Classic block in the inserter.

@tyxla tyxla self-assigned this May 5, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

* @since 7.1.0
*/
function wp_declare_classic_block_necessary() {
global $post;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Add missing doc block for global

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants