Skip to content

Commit 8906a00

Browse files
committed
Media: Add external icon to alt text links.
This link opens in a new tab, and needs a visual indicator to provide an affordance to sighted users that this will happen. Props burtrw, sabernhardt, audrasjb, westonruter, joedolson. Fixes #64374. git-svn-id: https://develop.svn.wordpress.org/trunk@61597 602fd350-edb4-49c9-b593-d223f7449a82
1 parent fc0cdbc commit 8906a00

4 files changed

Lines changed: 10 additions & 2 deletions

File tree

src/wp-admin/css/common.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@
139139
.screen-reader-text + .dashicons-external {
140140
margin-top: -1px;
141141
margin-left: 2px;
142+
text-decoration: none;
142143
}
143144

144145
.screen-reader-shortcut {

src/wp-admin/includes/media.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3245,7 +3245,7 @@ function edit_form_image_editor( $post ) {
32453245
esc_url( __( 'https://www.w3.org/WAI/tutorials/images/decision-tree/' ) ),
32463246
'target="_blank"',
32473247
sprintf(
3248-
'<span class="screen-reader-text"> %s</span>',
3248+
'<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span>',
32493249
/* translators: Hidden accessibility text. */
32503250
__( '(opens in a new tab)' )
32513251
)

src/wp-includes/css/media-views.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,13 @@
503503
float: right;
504504
}
505505

506+
.attachment-details .setting + .description .dashicons {
507+
width: 16px;
508+
height: 16px;
509+
font-size: 16px;
510+
margin-top: 0px;
511+
}
512+
506513
.media-sidebar .setting .value,
507514
.attachment-details .setting .value,
508515
.attachment-details .setting + .description {

src/wp-includes/media-template.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ function wp_print_media_templates() {
163163
esc_url( __( 'https://www.w3.org/WAI/tutorials/images/decision-tree/' ) ),
164164
'target="_blank"',
165165
sprintf(
166-
'<span class="screen-reader-text"> %s</span>',
166+
'<span class="screen-reader-text"> %s</span><span aria-hidden="true" class="dashicons dashicons-external"></span>',
167167
/* translators: Hidden accessibility text. */
168168
__( '(opens in a new tab)' )
169169
)

0 commit comments

Comments
 (0)