From e74f0acc19f522a2d1bf5dd7ffff13b98fc524db Mon Sep 17 00:00:00 2001 From: Gerhard Date: Tue, 29 Jan 2019 13:34:04 +0200 Subject: [PATCH 1/4] Add a screen reader label to the star rating div to avoid screen readers trying to read the text of the star font. --- includes/wc-template-functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index e2e08da9684..5ce09d294a3 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -3292,7 +3292,8 @@ function wc_get_stock_html( $product ) { * @return string */ function wc_get_rating_html( $rating, $count = 0 ) { - $html = 0 < $rating ? '
' . wc_get_star_rating_html( $rating, $count ) . '
' : ''; + /* translators: screen reader rating value */ + $html = 0 < $rating ? '
' . wc_get_star_rating_html( $rating, $count ) . '
' : ''; return apply_filters( 'woocommerce_product_get_rating_html', $html, $rating, $count ); } From 94f64f385114f6f62003e995b396a27469256243 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Tue, 29 Jan 2019 13:36:16 +0200 Subject: [PATCH 2/4] PHPCS fixes --- includes/wc-template-functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 5ce09d294a3..0efd5b76cc1 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -910,7 +910,7 @@ if ( ! function_exists( 'woocommerce_content' ) ) { - ' . get_the_title() . ''; + echo '

' . esc_html( get_the_title() ) . '

'; } } if ( ! function_exists( 'woocommerce_template_loop_category_title' ) ) { From 69baf175c1b18034db70e12f0bf8204ff41a0387 Mon Sep 17 00:00:00 2001 From: Gerhard Date: Tue, 29 Jan 2019 13:48:47 +0200 Subject: [PATCH 3/4] After some testing using area-hidden seems to deliver the best results for not producing the hissing sound on reviews. --- includes/wc-template-functions.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 0efd5b76cc1..8df4e80f289 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -3292,8 +3292,7 @@ function wc_get_stock_html( $product ) { * @return string */ function wc_get_rating_html( $rating, $count = 0 ) { - /* translators: screen reader rating value */ - $html = 0 < $rating ? '
' . wc_get_star_rating_html( $rating, $count ) . '
' : ''; + $html = 0 < $rating ? '' : ''; return apply_filters( 'woocommerce_product_get_rating_html', $html, $rating, $count ); } From e3f2cad544ecc3c9043c09be5c51717c933c82e9 Mon Sep 17 00:00:00 2001 From: Mike Jolley Date: Fri, 1 Feb 2019 16:10:14 +0000 Subject: [PATCH 4/4] Remove escape --- includes/wc-template-functions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/wc-template-functions.php b/includes/wc-template-functions.php index 8df4e80f289..b1fa994903a 100644 --- a/includes/wc-template-functions.php +++ b/includes/wc-template-functions.php @@ -1066,7 +1066,7 @@ if ( ! function_exists( 'woocommerce_template_loop_product_title' ) ) { * Show the product title in the product loop. By default this is an H2. */ function woocommerce_template_loop_product_title() { - echo '

' . esc_html( get_the_title() ) . '

'; + echo '

' . get_the_title() . '

'; // phpcs:ignore } } if ( ! function_exists( 'woocommerce_template_loop_category_title' ) ) {