Skip to content

Commit

Permalink
Removes the Post Content block from the inserter in the post editor a…
Browse files Browse the repository at this point in the history
…s it can't be used there (#50620)
  • Loading branch information
glendaviesnz authored May 15, 2023
1 parent a0e2d1d commit fc714ab
Showing 1 changed file with 3 additions and 2 deletions.
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

1 comment on commit fc714ab

@github-actions
Copy link

Choose a reason for hiding this comment

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

Flaky tests detected in fc714ab.
Some tests passed with failed attempts. The failures may not be related to this commit but are still reported for visibility. See the documentation for more information.

🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/4985929543
📝 Reported issues:

Please sign in to comment.