[Accessibility] Add scope attribute to the product attributes table (#49768)

* Add scope attribute to the product attrubutes table

* Update changelog

* Add changelog

* Bump version to 9.2.0

* Add a label to the table

* Update plugins/woocommerce/templates/single-product/product-attributes.php

Co-authored-by: Darin Kotter <darin.kotter@gmail.com>

* Revert "Update changelog"

This reverts commit 4c29c17f0a.

* Update product-attributes.php

Co-authored-by: Darin Kotter <darin.kotter@gmail.com>

* Update changelog to reflect aria-label

* Bump template version

---------

Co-authored-by: amesplant <95257231+amesplant-dmv@users.noreply.github.com>
Co-authored-by: Darin Kotter <darin.kotter@gmail.com>
Co-authored-by: Naman Malhotra <naman03malhotra@gmail.com>
Co-authored-by: Bart Kalisz <bartlomiej.kalisz@gmail.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
This commit is contained in:
Ames Plant 2024-08-16 04:04:02 -05:00 committed by GitHub
parent fc7afb41f1
commit 5f43827f7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 7 additions and 3 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Add scope attribute and aria-label to the product attributes table

View File

@ -14,7 +14,7 @@
*
* @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates
* @version 3.6.0
* @version 9.3.0
*/
defined( 'ABSPATH' ) || exit;
@ -23,10 +23,10 @@ if ( ! $product_attributes ) {
return;
}
?>
<table class="woocommerce-product-attributes shop_attributes">
<table class="woocommerce-product-attributes shop_attributes" aria-label="<?php esc_attr_e( 'Product Details', 'woocommerce' ); ?>">
<?php foreach ( $product_attributes as $product_attribute_key => $product_attribute ) : ?>
<tr class="woocommerce-product-attributes-item woocommerce-product-attributes-item--<?php echo esc_attr( $product_attribute_key ); ?>">
<th class="woocommerce-product-attributes-item__label"><?php echo wp_kses_post( $product_attribute['label'] ); ?></th>
<th class="woocommerce-product-attributes-item__label" scope="row"><?php echo wp_kses_post( $product_attribute['label'] ); ?></th>
<td class="woocommerce-product-attributes-item__value"><?php echo wp_kses_post( $product_attribute['value'] ); ?></td>
</tr>
<?php endforeach; ?>