From cf9fbb22485c8d25a332b51dfbe7cfa20bda1f25 Mon Sep 17 00:00:00 2001 From: Peter Fabian Date: Mon, 27 Mar 2023 15:39:49 +0200 Subject: [PATCH] Updated accessibility for product categories shortcode. --- plugins/woocommerce/includes/wc-template-functions.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/woocommerce/includes/wc-template-functions.php b/plugins/woocommerce/includes/wc-template-functions.php index c376d601e47..a069ecc3c28 100644 --- a/plugins/woocommerce/includes/wc-template-functions.php +++ b/plugins/woocommerce/includes/wc-template-functions.php @@ -1223,7 +1223,10 @@ if ( ! function_exists( 'woocommerce_template_loop_category_link_open' ) ) { * @param int|object|string $category Category ID, Object or String. */ function woocommerce_template_loop_category_link_open( $category ) { - echo ''; + $category_term = get_term( $category, 'product_cat' ); + $category_name = ( ! $category_term || is_wp_error( $category_term ) ) ? '' : $category_term->name; + /* translators: %s: Category name */ + echo ''; } }