From e4e9e19f4a69e5b950800256c50006b4d942d2c1 Mon Sep 17 00:00:00 2001 From: Andrea Fercia Date: Fri, 19 Feb 2016 15:09:51 +0000 Subject: [PATCH] Accessibility: after [36000] conditionally print out the `aria-describedby` attribute on the Featured Image postbox. Fixes #35076. git-svn-id: https://develop.svn.wordpress.org/trunk@36584 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-admin/includes/post.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wp-admin/includes/post.php b/src/wp-admin/includes/post.php index 74b3510163..1b2812c4a3 100644 --- a/src/wp-admin/includes/post.php +++ b/src/wp-admin/includes/post.php @@ -1380,11 +1380,12 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { $post = get_post( $post ); $post_type_object = get_post_type_object( $post->post_type ); - $set_thumbnail_link = '

%s

'; + $set_thumbnail_link = '

%s

'; $upload_iframe_src = get_upload_iframe_src( 'image', $post->ID ); $content = sprintf( $set_thumbnail_link, esc_url( $upload_iframe_src ), + '', // Empty when there's no featured image set, `aria-describedby` attribute otherwise. esc_html( $post_type_object->labels->set_featured_image ) ); @@ -1416,6 +1417,7 @@ function _wp_post_thumbnail_html( $thumbnail_id = null, $post = null ) { $ajax_nonce = wp_create_nonce( 'set_post_thumbnail-' . $post->ID ); $content = sprintf( $set_thumbnail_link, esc_url( $upload_iframe_src ), + ' aria-describedby="set-post-thumbnail-desc"', $thumbnail_html ); $content .= '

' . __( 'Click the image to edit or update' ) . '

';