Нема описа

product-thumbnails.php 1.3KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Single Product Thumbnails
  4. *
  5. * This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-thumbnails.php.
  6. *
  7. * HOWEVER, on occasion WooCommerce will need to update template files and you
  8. * (the theme developer) will need to copy the new files to your theme to
  9. * maintain compatibility. We try to do this as little as possible, but it does
  10. * happen. When this occurs the version of the template file will be bumped and
  11. * the readme will list any important changes.
  12. *
  13. * @see https://docs.woocommerce.com/document/template-structure/
  14. * @package WooCommerce\Templates
  15. * @version 3.5.1
  16. */
  17. defined( 'ABSPATH' ) || exit;
  18. // Note: `wc_get_gallery_image_html` was added in WC 3.3.2 and did not exist prior. This check protects against theme overrides being used on older versions of WC.
  19. if ( ! function_exists( 'wc_get_gallery_image_html' ) ) {
  20. return;
  21. }
  22. global $product;
  23. $attachment_ids = $product->get_gallery_image_ids();
  24. if ( $attachment_ids && $product->get_image_id() ) {
  25. foreach ( $attachment_ids as $attachment_id ) {
  26. echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', wc_get_gallery_image_html( $attachment_id ), $attachment_id ); // phpcs:disable WordPress.XSS.EscapeOutput.OutputNotEscaped
  27. }
  28. }