Skip to content

Commit

Permalink
[Block Library - Post Featured Image]: Fix uneditable placeholder whe…
Browse files Browse the repository at this point in the history
…n outside of a post context (#31663)
  • Loading branch information
ntsekouras authored May 11, 2021
1 parent d37bcb4 commit e141888
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/block-library/src/post-featured-image/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,9 @@ function PostFeaturedImageDisplay( {
const PostFeaturedImageWithNotices = withNotices( PostFeaturedImageDisplay );

export default function PostFeaturedImageEdit( props ) {
const blockProps = useBlockProps();
if ( ! props.context?.postId ) {
return placeholderChip;
return <div { ...blockProps }>{ placeholderChip }</div>;
}
return <PostFeaturedImageWithNotices { ...props } />;
}

0 comments on commit e141888

Please sign in to comment.