diff --git a/packages/block-library/src/post-featured-image/edit.js b/packages/block-library/src/post-featured-image/edit.js index cc0b2cfc6cd0cb..1fcf7af2b3b146 100644 --- a/packages/block-library/src/post-featured-image/edit.js +++ b/packages/block-library/src/post-featured-image/edit.js @@ -183,10 +183,15 @@ export default function PostFeaturedImageEdit( { let image; /** - * A post featured image block placed in a query loop - * does not have image replacement or upload options. + * A Post Featured Image block should not have image replacement + * or upload options in the following cases: + * - Is placed in a Query Loop. This is a consious decision to + * prevent content editing of different posts in Query Loop, and + * this could change in the future. + * - Is in a context where it does not have a postId (for example + * in a template or template part). */ - if ( ! featuredImage && isDescendentOfQueryLoop ) { + if ( ! featuredImage && ( isDescendentOfQueryLoop || ! postId ) ) { return ( <> { controls } @@ -202,32 +207,6 @@ export default function PostFeaturedImageEdit( { ); } - /** - * A post featured image placed in a block template, outside a query loop, - * does not have a postId and will always be a placeholder image. - * It does not have image replacement, upload, or link options. - */ - if ( ! featuredImage && ! postId ) { - return ( - <> - -
- { placeholder() } - -
- - ); - } - const label = __( 'Add a featured image' ); const imageStyles = { ...borderProps.style,