do not overwrite $image_ids (#500)

to include post thumbnail also for block-parser.
This commit is contained in:
Matthias Pfefferle 2023-10-10 20:48:59 +02:00 committed by GitHub
parent 1ef984da6c
commit 12b6750c94
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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(