From 12b6750c94b8f3d584bc22fdd7fa41d25f719c1e Mon Sep 17 00:00:00 2001 From: Matthias Pfefferle Date: Tue, 10 Oct 2023 20:48:59 +0200 Subject: [PATCH] do not overwrite $image_ids (#500) to include post thumbnail also for block-parser. --- includes/transformer/class-post.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/transformer/class-post.php b/includes/transformer/class-post.php index dbe9693..6e2f0aa 100644 --- a/includes/transformer/class-post.php +++ b/includes/transformer/class-post.php @@ -229,7 +229,8 @@ class Post { if ( $max_images > 0 ) { // first try to get images that are actually in the post content if ( site_supports_blocks() && \has_blocks( $this->wp_post->post_content ) ) { - $image_ids = $this->get_block_image_ids( $max_images, $image_ids ); + $block_image_ids = $this->get_block_image_ids( $max_images, $image_ids ); + $image_ids = \array_merge( $image_ids, $block_image_ids ); } else { // fallback to images attached to the post $query = new \WP_Query(