Ensure Product on Store API always contain an array of images that can be encoded into a JSON array (no named indexes), as per its own schema declaration. (https://github.com/woocommerce/woocommerce-blocks/pull/8499)
This commit is contained in:
parent
e580c1a6af
commit
78b4e3fcb7
|
@ -494,7 +494,7 @@ class ProductSchema extends AbstractSchema {
|
|||
protected function get_images( \WC_Product $product ) {
|
||||
$attachment_ids = array_merge( [ $product->get_image_id() ], $product->get_gallery_image_ids() );
|
||||
|
||||
return array_filter( array_map( [ $this->image_attachment_schema, 'get_item_response' ], $attachment_ids ) );
|
||||
return array_values( array_filter( array_map( [ $this->image_attachment_schema, 'get_item_response' ], $attachment_ids ) ) );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue