From f226f7b7f179b602aa05619d823940a06ae89e49 Mon Sep 17 00:00:00 2001 From: Aki Hamano <54422211+t-hamano@users.noreply.github.com> Date: Wed, 25 Dec 2024 14:05:05 +0900 Subject: [PATCH] Show metabox when pattern is accessed directly (#68255) Co-authored-by: t-hamano Co-authored-by: stokesman --- packages/edit-post/src/components/layout/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/edit-post/src/components/layout/index.js b/packages/edit-post/src/components/layout/index.js index 94db337d34f171..acc71afe1db0a8 100644 --- a/packages/edit-post/src/components/layout/index.js +++ b/packages/edit-post/src/components/layout/index.js @@ -407,6 +407,9 @@ function Layout( { const isRenderingPostOnly = getRenderingMode() === 'post-only'; const isNotDesignPostType = ! DESIGN_POST_TYPES.includes( currentPostType ); + const isDirectlyEditingPattern = + currentPostType === 'wp_block' && + ! onNavigateToPreviousEntityRecord; return { mode: getEditorMode(), @@ -417,7 +420,9 @@ function Layout( { !! select( blockEditorStore ).getBlockSelectionStart(), showIconLabels: get( 'core', 'showIconLabels' ), isDistractionFree: get( 'core', 'distractionFree' ), - showMetaBoxes: isNotDesignPostType && ! isZoomOut(), + showMetaBoxes: + ( isNotDesignPostType && ! isZoomOut() ) || + isDirectlyEditingPattern, isWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ), templateId: supportsTemplateMode && @@ -435,6 +440,7 @@ function Layout( { currentPostId, isEditingTemplate, settings.supportsTemplateMode, + onNavigateToPreviousEntityRecord, ] ); useMetaBoxInitialization( hasActiveMetaboxes );