Skip to content

Commit

Permalink
Revert "Omit meta boxes on “design” type posts (WordPress#64990)"
Browse files Browse the repository at this point in the history
This reverts commit fe5a931.
  • Loading branch information
huubl authored Oct 2, 2024
1 parent a270bfd commit e7042d2
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions packages/edit-post/src/components/layout/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,15 +398,14 @@ function Layout( {
const shouldIframe = useShouldIframe();
const { createErrorNotice } = useDispatch( noticesStore );
const {
currentPost: { postId: currentPostId, postType: currentPostType },
currentPost,
onNavigateToEntityRecord,
onNavigateToPreviousEntityRecord,
} = useNavigateToEntityRecord(
initialPostId,
initialPostType,
'post-only'
);
const isEditingTemplate = currentPostType === 'wp_template';
const {
mode,
isFullscreenActive,
Expand All @@ -416,6 +415,7 @@ function Layout( {
isDistractionFree,
showMetaBoxes,
hasHistory,
isEditingTemplate,
isWelcomeGuideVisible,
templateId,
} = useSelect(
Expand All @@ -428,7 +428,7 @@ function Layout( {

const supportsTemplateMode = settings.supportsTemplateMode;
const isViewable =
getPostType( currentPostType )?.viewable ?? false;
getPostType( currentPost.postType )?.viewable ?? false;
const canViewTemplate = canUser( 'read', {
kind: 'postType',
name: 'wp_template',
Expand All @@ -444,19 +444,21 @@ function Layout( {
showIconLabels: get( 'core', 'showIconLabels' ),
isDistractionFree: get( 'core', 'distractionFree' ),
showMetaBoxes:
! DESIGN_POST_TYPES.includes( currentPostType ) &&
select( editorStore ).getRenderingMode() === 'post-only',
isEditingTemplate:
select( editorStore ).getCurrentPostType() ===
'wp_template',
isWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),
templateId:
supportsTemplateMode &&
isViewable &&
canViewTemplate &&
! isEditingTemplate
currentPost.postType !== 'wp_template'
? getEditedPostTemplateId()
: null,
};
},
[ currentPostType, isEditingTemplate, settings.supportsTemplateMode ]
[ settings.supportsTemplateMode, currentPost.postType ]
);

// Set the right context for the command palette
Expand Down Expand Up @@ -566,12 +568,12 @@ function Layout( {
<SlotFillProvider>
<ErrorBoundary>
<CommandMenu />
<WelcomeGuide postType={ currentPostType } />
<WelcomeGuide postType={ currentPost.postType } />
<Editor
settings={ editorSettings }
initialEdits={ initialEdits }
postType={ currentPostType }
postId={ currentPostId }
postType={ currentPost.postType }
postId={ currentPost.postId }
templateId={ templateId }
className={ className }
styles={ styles }
Expand All @@ -583,7 +585,7 @@ function Layout( {
autoFocus={ ! isWelcomeGuideVisible }
onActionPerformed={ onActionPerformed }
extraSidebarPanels={
showMetaBoxes && <MetaBoxes location="side" />
! isEditingTemplate && <MetaBoxes location="side" />
}
extraContent={
! isDistractionFree &&
Expand Down

0 comments on commit e7042d2

Please sign in to comment.