Administration: Add "(link opens in a new window)" as a screen reader text for "Preview" link on Edit Post screen.

Props rianrietveld.
Fixes #40185.

git-svn-id: https://develop.svn.wordpress.org/trunk@40422 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov 2017-04-13 22:41:50 +00:00
parent 11d450f47e
commit a844db32e2
1 changed files with 8 additions and 2 deletions

View File

@ -50,10 +50,16 @@ function post_submit_meta_box( $post, $args = array() ) {
<?php
$preview_link = esc_url( get_preview_post_link( $post ) );
if ( 'publish' == $post->post_status ) {
$preview_button = __( 'Preview Changes' );
$preview_button_text = __( 'Preview Changes' );
} else {
$preview_button = __( 'Preview' );
$preview_button_text = __( 'Preview' );
}
$preview_button = sprintf( '%1$s<span class="screen-reader-text"> %2$s</span>',
$preview_button_text,
/* translators: accessibility text */
__( '(link opens in a new window)' )
);
?>
<a class="preview button" href="<?php echo $preview_link; ?>" target="wp-preview-<?php echo (int) $post->ID; ?>" id="post-preview"><?php echo $preview_button; ?></a>
<input type="hidden" name="wp-preview" id="wp-preview" value="" />