Introduce `woocommerce_reviews_title` filter

This commit is contained in:
Ron Rennick 2018-11-14 14:41:56 -04:00
parent f39b006264
commit 177145b6a5
1 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,7 @@
* @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates
* @version 3.5.0
* @version 3.5.2
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly
@ -31,7 +31,8 @@ if ( ! comments_open() ) {
<h2 class="woocommerce-Reviews-title"><?php
if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' && ( $count = $product->get_review_count() ) ) {
/* translators: 1: reviews count 2: product name */
printf( esc_html( _n( '%1$s review for %2$s', '%1$s reviews for %2$s', $count, 'woocommerce' ) ), esc_html( $count ), '<span>' . get_the_title() . '</span>' );
$reviews_title = sprintf( esc_html( _n( '%1$s review for %2$s', '%1$s reviews for %2$s', $count, 'woocommerce' ) ), esc_html( $count ), '<span>' . get_the_title() . '</span>' );
echo apply_filters( 'woocommerce_reviews_title', $reviews_title, $count, $product );
} else {
_e( 'Reviews', 'woocommerce' );
}