Replace figure tags with divs. closes #13546

For easier theme support
This commit is contained in:
James Koster 2017-03-14 10:42:21 +00:00
parent ad1073c212
commit 53b7844412
2 changed files with 6 additions and 6 deletions

View File

@ -45,13 +45,13 @@ $wrapper_classes = apply_filters( 'woocommerce_single_product_image_gallery_cl
); );
if ( has_post_thumbnail() ) { if ( has_post_thumbnail() ) {
$html = '<figure data-thumb="' . get_the_post_thumbnail_url( $post->ID, 'shop_thumbnail' ) . '" class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">'; $html = '<div data-thumb="' . get_the_post_thumbnail_url( $post->ID, 'shop_thumbnail' ) . '" class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">';
$html .= get_the_post_thumbnail( $post->ID, 'shop_single', $attributes ); $html .= get_the_post_thumbnail( $post->ID, 'shop_single', $attributes );
$html .= '</a></figure>'; $html .= '</a></div>';
} else { } else {
$html = '<figure class="woocommerce-product-gallery__image--placeholder">'; $html = '<div class="woocommerce-product-gallery__image--placeholder">';
$html .= sprintf( '<img src="%s" alt="%s" class="wp-post-image" />', esc_url( wc_placeholder_img_src() ), esc_html__( 'Awaiting product image', 'woocommerce' ) ); $html .= sprintf( '<img src="%s" alt="%s" class="wp-post-image" />', esc_url( wc_placeholder_img_src() ), esc_html__( 'Awaiting product image', 'woocommerce' ) );
$html .= '</figure>'; $html .= '</div>';
} }
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, get_post_thumbnail_id( $post->ID ) ); echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, get_post_thumbnail_id( $post->ID ) );

View File

@ -38,9 +38,9 @@ if ( $attachment_ids && has_post_thumbnail() ) {
'data-large-image-height' => $full_size_image[2], 'data-large-image-height' => $full_size_image[2],
); );
$html = '<figure data-thumb="' . esc_url( $thumbnail[0] ) . '" class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">'; $html = '<div data-thumb="' . esc_url( $thumbnail[0] ) . '" class="woocommerce-product-gallery__image"><a href="' . esc_url( $full_size_image[0] ) . '">';
$html .= wp_get_attachment_image( $attachment_id, 'shop_single', false, $attributes ); $html .= wp_get_attachment_image( $attachment_id, 'shop_single', false, $attributes );
$html .= '</a></figure>'; $html .= '</a></div>';
echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $attachment_id ); echo apply_filters( 'woocommerce_single_product_image_thumbnail_html', $html, $attachment_id );
} }