diff --git a/packages/editor/src/components/document-bar/index.js b/packages/editor/src/components/document-bar/index.js index 7b94a6fbeb3be..f5ca65dfe18ed 100644 --- a/packages/editor/src/components/document-bar/index.js +++ b/packages/editor/src/components/document-bar/index.js @@ -54,6 +54,7 @@ const MotionButton = motion( Button ); */ export default function DocumentBar( props ) { const { + postId, postType, postTypeLabel, documentTitle, @@ -93,6 +94,7 @@ export default function DocumentBar( props ) { const _postTypeLabel = getPostType( _postType )?.labels?.singular_name; return { + postId: _postId, postType: _postType, postTypeLabel: _postTypeLabel, documentTitle: _document.title, @@ -120,7 +122,7 @@ export default function DocumentBar( props ) { const title = props.title || entityTitle; const icon = props.icon; - const pageTypeBadge = usePageTypeBadge(); + const pageTypeBadge = usePageTypeBadge( postId ); const mountedRef = useRef( false ); useEffect( () => { diff --git a/packages/editor/src/components/post-card-panel/index.js b/packages/editor/src/components/post-card-panel/index.js index c8264a30d9723..f6f5c3deca9f5 100644 --- a/packages/editor/src/components/post-card-panel/index.js +++ b/packages/editor/src/components/post-card-panel/index.js @@ -64,7 +64,7 @@ export default function PostCardPanel( { [ postId, postType ] ); - const pageTypeBadge = usePageTypeBadge(); + const pageTypeBadge = usePageTypeBadge( parseInt( postId, 10 ) ); return (