Introduce `woocommerce_reviews_title` filter
This commit is contained in:
parent
f39b006264
commit
177145b6a5
|
@ -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.5.0
|
* @version 3.5.2
|
||||||
*/
|
*/
|
||||||
if ( ! defined( 'ABSPATH' ) ) {
|
if ( ! defined( 'ABSPATH' ) ) {
|
||||||
exit; // Exit if accessed directly
|
exit; // Exit if accessed directly
|
||||||
|
@ -31,7 +31,8 @@ if ( ! comments_open() ) {
|
||||||
<h2 class="woocommerce-Reviews-title"><?php
|
<h2 class="woocommerce-Reviews-title"><?php
|
||||||
if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' && ( $count = $product->get_review_count() ) ) {
|
if ( get_option( 'woocommerce_enable_review_rating' ) === 'yes' && ( $count = $product->get_review_count() ) ) {
|
||||||
/* translators: 1: reviews count 2: product name */
|
/* 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 {
|
} else {
|
||||||
_e( 'Reviews', 'woocommerce' );
|
_e( 'Reviews', 'woocommerce' );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue