#2906 - Set reviews count in tab to only count actual reviews
Nested comments shouldn’t be treated as reviews. This addresses that by using `$product->get_rating_count()` to determine the correct number of reviews, instead of get_comments_number. It can be filtered using the new `woocommerce_product_reviews_count` filter.
This commit is contained in:
parent
b4e544e5dc
commit
985df5bca4
|
@ -1022,7 +1022,7 @@ if ( ! function_exists( 'woocommerce_default_product_tabs' ) ) {
|
|||
// Reviews tab - shows comments
|
||||
if ( comments_open() ) {
|
||||
$tabs['reviews'] = array(
|
||||
'title' => sprintf( __( 'Reviews (%d)', 'woocommerce' ), get_comments_number( $post->ID ) ),
|
||||
'title' => sprintf( __( 'Reviews (%d)', 'woocommerce' ), apply_filters( 'woocommerce_product_reviews_count', $product->get_rating_count() ) ),
|
||||
'priority' => 30,
|
||||
'callback' => 'comments_template'
|
||||
);
|
||||
|
|
Loading…
Reference in New Issue