Media: After [42693], update HTML4 markup in img_caption_shortcode() to avoid an empty ID attribute as well.

Add a unit test for `aria-describedby` in `img_caption_shortcode()`.

See #34595.

git-svn-id: https://develop.svn.wordpress.org/trunk@42694 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Sergey Biryukov
2018-02-11 15:39:20 +00:00
parent bff366759c
commit 0711e585fb
2 changed files with 16 additions and 1 deletions
+1 -1
View File
@@ -1623,7 +1623,7 @@ function img_caption_shortcode( $attr, $content = null ) {
esc_attr( $class ),
str_replace( '<img ', '<img ' . $describedby, do_shortcode( $content ) ),
sprintf(
'<p id="%s" class="wp-caption-text">%s</p>',
'<p %sclass="wp-caption-text">%s</p>',
$atts['caption_id'],
$atts['caption']
)