From fc714ab6704e8c159bcfbbdd63b26e76fe1c346c Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Tue, 16 May 2023 10:57:02 +1200 Subject: [PATCH] Removes the Post Content block from the inserter in the post editor as it can't be used there (#50620) --- packages/edit-post/src/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/edit-post/src/index.js b/packages/edit-post/src/index.js index 1e0509f3e8f218..156c434e7a3761 100644 --- a/packages/edit-post/src/index.js +++ b/packages/edit-post/src/index.js @@ -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. @@ -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; }