[Accessibility] Add address title to edit/add buttons on My Account page (#49171)

* Add address title to edit/add buttons on my account

* Add chengelog file

* Bump my-address template version

* Use placeholder in the edit/add address translation

* Replace sprintf with printf
This commit is contained in:
Gabriel Manussakis 2024-07-24 12:15:08 -03:00 committed by GitHub
parent 4689a09ec3
commit b796b90d68
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: enhancement
Add address title to edit/add buttons on My Account page

View File

@ -12,7 +12,7 @@
* *
* @see https://woocommerce.com/document/template-structure/ * @see https://woocommerce.com/document/template-structure/
* @package WooCommerce\Templates * @package WooCommerce\Templates
* @version 8.7.0 * @version 9.2.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -60,7 +60,15 @@ $col = 1;
<div class="u-column<?php echo $col < 0 ? 1 : 2; ?> col-<?php echo $oldcol < 0 ? 1 : 2; ?> woocommerce-Address"> <div class="u-column<?php echo $col < 0 ? 1 : 2; ?> col-<?php echo $oldcol < 0 ? 1 : 2; ?> woocommerce-Address">
<header class="woocommerce-Address-title title"> <header class="woocommerce-Address-title title">
<h3><?php echo esc_html( $address_title ); ?></h3> <h3><?php echo esc_html( $address_title ); ?></h3>
<a href="<?php echo esc_url( wc_get_endpoint_url( 'edit-address', $name ) ); ?>" class="edit"><?php echo $address ? esc_html__( 'Edit', 'woocommerce' ) : esc_html__( 'Add', 'woocommerce' ); ?></a> <a href="<?php echo esc_url( wc_get_endpoint_url( 'edit-address', $name ) ); ?>" class="edit">
<?php
printf(
/* translators: %s: Address title */
$address ? esc_html__( 'Edit %s', 'woocommerce' ) : esc_html__( 'Add %s', 'woocommerce' ),
esc_html( $address_title )
);
?>
</a>
</header> </header>
<address> <address>
<?php <?php