Media: In `img_caption_shortcode()`, make sure `$id` and `$caption_id` are always defined.

See #34595.
Built from https://develop.svn.wordpress.org/trunk@42706


git-svn-id: http://core.svn.wordpress.org/trunk@42534 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2018-02-12 22:36:33 +00:00
parent 0306b3f637
commit dfa6839706
2 changed files with 3 additions and 3 deletions

View File

@ -1560,6 +1560,8 @@ function img_caption_shortcode( $attr, $content = null ) {
return $content;
}
$id = $caption_id = $describedby = '';
if ( $atts['id'] ) {
$atts['id'] = sanitize_html_class( $atts['id'] );
$id = 'id="' . esc_attr( $atts['id'] ) . '" ';
@ -1571,8 +1573,6 @@ function img_caption_shortcode( $attr, $content = null ) {
$atts['caption_id'] = 'caption-' . str_replace( '_', '-', $atts['id'] );
}
$describedby = '';
if ( $atts['caption_id'] ) {
$caption_id = 'id="' . esc_attr( $atts['caption_id'] ) . '" ';
$describedby = 'aria-describedby="' . esc_attr( $atts['caption_id'] ) . '" ';

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42705';
$wp_version = '5.0-alpha-42706';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.