Skip to content

Commit

Permalink
Show metabox when pattern is accessed directly (WordPress#68255)
Browse files Browse the repository at this point in the history
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: stokesman <[email protected]>
  • Loading branch information
3 people authored Dec 25, 2024
1 parent e5bc2a1 commit f226f7b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand All @@ -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 &&
Expand All @@ -435,6 +440,7 @@ function Layout( {
currentPostId,
isEditingTemplate,
settings.supportsTemplateMode,
onNavigateToPreviousEntityRecord,
]
);
useMetaBoxInitialization( hasActiveMetaboxes );
Expand Down

0 comments on commit f226f7b

Please sign in to comment.