Woocommerce 3.1.0 Compatability

This commit is contained in:
Jason King 2017-06-29 22:16:27 +09:30 committed by GitHub
parent ce97bab35a
commit fef3d20771
1 changed files with 5 additions and 6 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
/** /**
* Single Product Thumbnails * Single Product Thumbnails
* Updated for Understrap to maintain Woocommerce 3.0.3 compatability. *
* This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-thumbnails.php. * This template can be overridden by copying it to yourtheme/woocommerce/single-product/product-thumbnails.php.
* *
* HOWEVER, on occasion WooCommerce will need to update template files and you * HOWEVER, on occasion WooCommerce will need to update template files and you
@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes * @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 3.0.2 * @version 3.1.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
@ -28,10 +28,9 @@ if ( $attachment_ids && has_post_thumbnail() ) {
foreach ( $attachment_ids as $attachment_id ) { foreach ( $attachment_ids as $attachment_id ) {
$full_size_image = wp_get_attachment_image_src( $attachment_id, 'full' ); $full_size_image = wp_get_attachment_image_src( $attachment_id, 'full' );
$thumbnail = wp_get_attachment_image_src( $attachment_id, 'shop_thumbnail' ); $thumbnail = wp_get_attachment_image_src( $attachment_id, 'shop_thumbnail' );
$image_title = get_post_field( 'post_excerpt', $attachment_id ); $attributes = array(
'title' => get_post_field( 'post_title', $attachment_id ),
$attributes = array( 'data-caption' => get_post_field( 'post_excerpt', $attachment_id ),
'title' => $image_title,
'data-src' => $full_size_image[0], 'data-src' => $full_size_image[0],
'data-large_image' => $full_size_image[0], 'data-large_image' => $full_size_image[0],
'data-large_image_width' => $full_size_image[1], 'data-large_image_width' => $full_size_image[1],