Make WordPress Core

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#52891 closed defect (bug) (fixed)

Privacy: print screen reader text message

Reported by: mukesh27's profile mukesh27 Owned by: davidbaumwald's profile 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.


3 years ago
#1

  • Keywords has-patch added

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

#5 @sabernhardt
3 years 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 years ago
#6

  • Keywords needs-refresh removed

#7 @mukesh27
3 years ago

PR #1119 patch updated.

#8 @davidbaumwald
3 years ago

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

#9 @davidbaumwald
3 years 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
3 years 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
3 years ago

  • Keywords dev-feedback added

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

#12 @desrosj
3 years ago

  • Keywords dev-reviewed added; dev-feedback removed

Looks good for backport, @davidbaumwald!

#13 @davidbaumwald
3 years 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
3 years 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
3 years 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.