Woocommerce 3.1.0 Compatability

This commit is contained in:
Jason King 2017-06-29 22:19:15 +09:30 committed by GitHub
parent 05bd3a0606
commit 6d429df698
1 changed files with 6 additions and 13 deletions

View File

@ -1,8 +1,8 @@
<?php
/**
* The template to display the reviewers star rating in reviews
* Updated for Understrap to maintain Woocommerce 3.0.3 compatability.
* This template can be overridden by copying it to yourtheme/woocommerce/content-product.php.
*
* This template can be overridden by copying it to yourtheme/woocommerce/review-rating.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.0.0
* @version 3.1.0
*/
if ( ! defined( 'ABSPATH' ) ) {
@ -23,13 +23,6 @@ if ( ! defined( 'ABSPATH' ) ) {
global $comment;
$rating = intval( get_comment_meta( $comment->comment_ID, 'rating', true ) );
if ( $rating && get_option( 'woocommerce_enable_review_rating' ) === 'yes' ) { ?>
<div class="star-rating">
<span style="width:<?php echo ( esc_attr( $rating ) / 5 ) * 100; ?>%"><?php
/* translators: %s: rating */
printf( esc_html__( '%s out of 5', 'understrap' ), '<strong>' . $rating . '</strong>' );
?></span>
</div>
<?php }
if ( $rating && 'yes' === get_option( 'woocommerce_enable_review_rating' ) ) {
echo wc_get_rating_html( $rating );
}