Added foreach loop wrapper

This commit is contained in:
2024-11-05 07:06:09 +00:00
parent 77c5d3e711
commit c2d8dcd692

View File

@ -1,4 +1,14 @@
// Check if the block is a 'core/post-featured-image' foreach ( $inner_blocks as $block ) {
if ( 'core/post-featured-image' === $block->name ) { if ( 'core/post-featured-image' === $block->name ) {
return true; // Found a block using the featured image return true;
}
if (
'core/cover' === $block->name &&
! empty( $block->attributes['useFeaturedImage'] )
) {
return true;
}
if ( $block->inner_blocks && block_core_post_template_uses_featured_image( $block->inner_blocks ) ) {
return true;
}
} }