Skip to content

Hide Embeds tab in the block insert menu if no embeds are registered - #5830

Closed
paulwilde wants to merge 2 commits into
WordPress:masterfrom
paulwilde:fix/hide-embeds-tab-when-empty
Closed

paulwilde wants to merge 2 commits into
WordPress:masterfrom
paulwilde:fix/hide-embeds-tab-when-empty

Conversation

@paulwilde

@paulwilde paulwilde commented Mar 27, 2018 •

Copy link
Copy Markdown
Contributor

Fixes #3992.

Removes the Embeds tab from the block insert menu if no embeds exist.

Add the following filter to replicate:

add_filter( 'allowed_block_types', function() {
    return [ 'core/paragraph', 'core/heading', 'core/image' ];
}, 10 );

Screenshot with filter applied:

screen shot 2018-03-27 at 21 35 09

@aduth aduth left a comment

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.

I see there are some unit tests for InserterMenu. Would you care to try to see if it might be possible to test this behavior?

A question: Should this be limited to embed? What about shared blocks?

@gziolo

gziolo commented Jun 12, 2018 •

Copy link
Copy Markdown
Member

This issue was fixed together with UI refinements introduced in #6636:
screen shot 2018-06-12 at 08 29 56

Thanks for working on this PR.

@gziolo gziolo closed this Jun 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants