WordPress.org

Make WordPress Core

Opened 10 months ago

Closed 10 months ago

Last modified 6 months ago

#52891 closed defect (bug) (fixed)

Privacy: print screen reader text message

Reported by: mukesh27 Owned by: davidbaumwald
Milestone: 5.7.1 Priority: normal
Severity: normal Version:
Component: Privacy Keywords: has-patch commit fixed-major dev-reviewed
Focuses: ui, accessibility, administration Cc:

Description

Print screen reader text message for privacy_policy_guide() function.

Change History (15)

This ticket was mentioned in PR #1114 on WordPress/wordpress-develop by mukeshpanchal27.


10 months ago

  • Keywords has-patch added

#2 follow-up: @carike
10 months ago

Could you please expand on this?
I'm not sure what this ticket does, or why?
I assume this is to improve accessibility, but not sure what was wrong?

#3 @SergeyBiryukov
10 months ago

  • Milestone changed from Awaiting Review to 5.7.1

Thanks for the ticket and the patch!

Moving to 5.7.1, as this was introduced in [50161] / #49264.

Just noting that echo sprintf() can be replaced with just printf().

#4 in reply to: ↑ 2 @SergeyBiryukov
10 months ago

Replying to carike:

I assume this is to improve accessibility, but not sure what was wrong?

The sprintf() function was erroneously used instead of printf(), so the screen reader text is not actually printed.

Last edited 10 months ago by SergeyBiryukov (previous) (diff)

#5 @sabernhardt
10 months ago

  • Keywords needs-refresh added

After switching to printf, screen readers would speak both the visible text plus the intended screen reader text:
"Copy suggested policy text to clipboard Copy suggested policy text from WordPress. button"

One way to fix the redundancy is wrapping the visible text with <span aria-hidden="true"></span>:

	<button type="button" class="privacy-text-copy button">
		<span aria-hidden="true"><?php _e( 'Copy suggested policy text to clipboard' ); ?></span>
		<span class="screen-reader-text">
			<?php
			/* translators: %s: Plugin name. */
			printf( __( 'Copy suggested policy text from %s.' ), $plugin_name );
			?>
		</span>
	</button>

This ticket was mentioned in PR #1119 on WordPress/wordpress-develop by mukeshpanchal27.


10 months ago

  • Keywords needs-refresh removed

#7 @mukesh27
10 months ago

PR #1119 patch updated.

#8 @davidbaumwald
10 months ago

  • Owner set to davidbaumwald
  • Status changed from new to accepted

#9 @davidbaumwald
10 months ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 50585:

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.
Fixes #52891.

#10 @SergeyBiryukov
10 months ago

  • Keywords commit fixed-major added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Reopening for backporting to the 5.7 branch.

#11 @davidbaumwald
10 months ago

  • Keywords dev-feedback added

Adding dev-feedback for a secondary review prior to backporting.

#12 @desrosj
10 months ago

  • Keywords dev-reviewed added; dev-feedback removed

Looks good for backport, @davidbaumwald!

#13 @davidbaumwald
10 months ago

  • Resolution set to fixed
  • Status changed from reopened to closed

In 50609:

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.

#14 @desrosj
6 months ago

In 51431:

Privacy: Ensure the copy button actually copies the suggested privacy policy text.

Follow up to [50609].

Props walbo, SergeyBiryukov.
Fixes #53652. See #52891.

#15 @desrosj
6 months ago

In 51433:

Privacy: Ensure the copy button actually copies the suggested privacy policy text.

Follow up to [50609].

Props walbo, SergeyBiryukov.
Merges [51431] to the 5.8 branch.
Fixes #53652. See #52891.

Note: See TracTickets for help on using tickets.