Skip to content

Commit d1508d5

Browse files
committed
Updates the alt text description text in both the media attachment post screen and media manager templates.
Updates the alt text description text in both the media attachment post screen and media manager templates. The new text is clearer and more concise, and includes an external link icon for better user experience. Trac ticket: https://core.trac.wordpress.org/ticket/64374 --- **This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See [GitHub Pull Requests for Code Review](https://make.wordpress.org/core/handbook/contribute/git/github-pull-requests-for-code-review/) in the Core Handbook for more details.**
1 parent 3a265ea commit d1508d5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

src/wp-admin/includes/media.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3237,16 +3237,17 @@ function edit_form_image_editor( $post ) {
32373237
<?php
32383238

32393239
printf(
3240-
/* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */
3241-
__( '<a href="%1$s" %2$s>Learn how to describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
3240+
/* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text, 4: External link icon. */
3241+
__( 'Alt text describes the image\'s purpose. Leave it blank if the image is purely decorative. <a href="%1$s" %2$s>Learn more about alt text%3$s%4$s</a>.' ),
32423242
/* translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. */
32433243
esc_url( __( 'https://www.w3.org/WAI/tutorials/images/decision-tree/' ) ),
32443244
'target="_blank"',
32453245
sprintf(
32463246
'<span class="screen-reader-text"> %s</span>',
32473247
/* translators: Hidden accessibility text. */
32483248
__( '(opens in a new tab)' )
3249-
)
3249+
),
3250+
'<span aria-hidden="true" class="dashicons dashicons-external"></span>'
32503251
);
32513252

32523253
?>

src/wp-includes/media-template.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,16 +157,17 @@ function wp_print_media_templates() {
157157
$class = 'media-modal wp-core-ui';
158158

159159
$alt_text_description = sprintf(
160-
/* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text. */
161-
__( '<a href="%1$s" %2$s>Learn how to describe the purpose of the image%3$s</a>. Leave empty if the image is purely decorative.' ),
160+
/* translators: 1: Link to tutorial, 2: Additional link attributes, 3: Accessibility text, 4: External link icon. */
161+
__( 'Alt text describes the image\'s purpose. Leave it blank if the image is purely decorative. <a href="%1$s" %2$s>Learn more about alt text%3$s%4$s</a>.' ),
162162
/* translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. */
163163
esc_url( __( 'https://www.w3.org/WAI/tutorials/images/decision-tree/' ) ),
164164
'target="_blank"',
165165
sprintf(
166166
'<span class="screen-reader-text"> %s</span>',
167167
/* translators: Hidden accessibility text. */
168168
__( '(opens in a new tab)' )
169-
)
169+
),
170+
'<span aria-hidden="true" class="dashicons dashicons-external"></span>'
170171
);
171172
?>
172173

0 commit comments

Comments
 (0)