Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes the Post Content block from the inserter in the post editor #50620

Merged
merged 1 commit into from
May 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions packages/edit-post/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export function initializeEditor(
}

/*
* Prevent adding template part in the post editor.
* Prevent adding template part and post content block in the post editor.
* Only add the filter when the post editor is initialized, not imported.
* Also only add the filter(s) after registerCoreBlocks()
* so that common filters in the block library are not overwritten.
Expand All @@ -90,7 +90,8 @@ export function initializeEditor(
( canInsert, blockType ) => {
if (
! select( editPostStore ).isEditingTemplate() &&
blockType.name === 'core/template-part'
( blockType.name === 'core/template-part' ||
blockType.name === 'core/post-content' )
) {
return false;
}
Expand Down