WordPress.org

Make WordPress Core

Opened 3 weeks ago

Closed 2 weeks 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 (13)

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


3 weeks ago

  • Keywords has-patch added

#2 follow-up: @carike
3 weeks 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
3 weeks 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
3 weeks 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 3 weeks ago by SergeyBiryukov (previous) (diff)

#5 @sabernhardt
3 weeks 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.


3 weeks ago

  • Keywords needs-refresh removed

#7 @mukesh27
3 weeks ago

PR #1119 patch updated.

#8 @davidbaumwald
3 weeks ago

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

#9 @davidbaumwald
2 weeks 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
2 weeks 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
2 weeks ago

  • Keywords dev-feedback added

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

#12 @desrosj
2 weeks ago

  • Keywords dev-reviewed added; dev-feedback removed

Looks good for backport, @davidbaumwald!

#13 @davidbaumwald
2 weeks 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.

Note: See TracTickets for help on using tickets.