1 ) { foreach ( array_slice( $media_items, 1 ) as $key => $media_item ) { $attachment_id = isset( $media_item['id'] ) ? absint( $media_item['id'] ) : 0; if ( ! $attachment_id ) { continue; } $is_video = 'video' === ( $media_item['media_type'] ?? '' ); if ( $is_video ) { $html = ProductMediaGallery::get_gallery_video_html( $media_item, false ); } else { $html = wc_get_gallery_image_html( $attachment_id, false, $key ); } if ( $is_video ) { /** * Filter product video thumbnail HTML string. * * @since 11.0.0 * @internal For exclusive usage of WooCommerce core, backwards compatibility not guaranteed. * * @param string $html Product video thumbnail HTML string. * @param int $attachment_id Video attachment ID. * @param array $media_item Product media gallery item. */ echo apply_filters( 'woocommerce_single_product_video_thumbnail_html', $html, $attachment_id, $media_item ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } else { /** * Filter product image thumbnail HTML string. * * @since 1.6.4 * * @param string $html Product image thumbnail HTML string. * @param int $attachment_id Attachment ID. */ echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $attachment_id ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } }