Automattic\WooCommerce\StoreApi\Schemas\V1
ProductSchema::get_images
Get list of product images.
Method of the class: ProductSchema{}
No Hooks.
Returns
Array.
Usage
// protected - for code of main (parent) or child class $result = $this->get_images( $product );
- $product(WC_Product) (required)
- Product instance.
ProductSchema::get_images() ProductSchema::get images code WC 10.6.2
protected function get_images( \WC_Product $product ) {
$attachment_ids = array_merge( [ $product->get_image_id() ], $product->get_gallery_image_ids() );
return array_values( array_filter( array_map( [ $this->image_attachment_schema, 'get_item_response' ], $attachment_ids ) ) );
}