Privacy: Print screen reader text for the "Copy suggested policy text..." action button.

This change switches out sprintf for printf on the "Copy suggested policy text from..." button screen reader text. Also, wrap the actual button text in a <span aria-hidden="true"> to prevent both the button text and the screen reader text from being spoken.

Props mukesh27, SergeyBiryukov, sabernhardt, desrosj.
Merges [50585] to the 5.7 branch.
Fixes #52891.
Built from https://develop.svn.wordpress.org/branches/5.7@50609


git-svn-id: http://core.svn.wordpress.org/branches/5.7@50222 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
davidbaumwald 2021-03-26 20:32:04 +00:00
parent 6e556a478a
commit 35592e1ffa
2 changed files with 3 additions and 3 deletions

View File

@ -420,11 +420,11 @@ final class WP_Privacy_Policy_Content {
<div class="privacy-settings-accordion-actions">
<span class="success" aria-hidden="true"><?php _e( 'Copied!' ); ?></span>
<button type="button" class="privacy-text-copy button">
<?php _e( 'Copy suggested policy text to clipboard' ); ?>
<span aria-hidden="true"><?php _e( 'Copy suggested policy text to clipboard' ); ?></span>
<span class="screen-reader-text">
<?php
/* translators: %s: Plugin name. */
sprintf( __( 'Copy suggested policy text from %s.' ), $plugin_name );
printf( __( 'Copy suggested policy text from %s.' ), $plugin_name );
?>
</span>
</button>

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.7.1-alpha-50608';
$wp_version = '5.7.1-alpha-50609';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.