diff --git a/tests/includes/transformer/class-test-post.php b/tests/includes/transformer/class-test-post.php index a6a07202c..803d86f5c 100644 --- a/tests/includes/transformer/class-test-post.php +++ b/tests/includes/transformer/class-test-post.php @@ -370,6 +370,16 @@ public function test_block_attachments_with_fallback() { ) ); + // For WP versions 6.1 and prior, we only look for attached images. + if ( ! class_exists( 'WP_HTML_Tag_Processor' ) ) { + wp_update_post( + array( + 'ID' => $attachment_id, + 'post_parent' => $post_id, + ) + ); + } + $object = Post::transform( get_post( $post_id ) )->to_object(); $this->assertEquals(