From f79e35f8a07774b5b9c27f7a87c3aeea24638f79 Mon Sep 17 00:00:00 2001 From: Glen Davies Date: Mon, 15 May 2023 12:39:50 +1200 Subject: [PATCH] Removes the Post Content block from the inserter in the post editor as it can't be used there --- 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; }