Changeset 42691
- Timestamp:
- 02/11/2018 02:43:40 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r42690 r42691 1558 1558 1559 1559 if ( ! empty( $atts['id'] ) ) { 1560 $atts['id'] = 'id="' . esc_attr( sanitize_html_class( $atts['id'] ) ) . '" '; 1561 } 1560 $att_id = esc_attr( sanitize_html_class( $atts['id'] ) ); 1561 $atts['id'] = 'id="' . $att_id . '" '; 1562 } 1563 1564 $caption_id = 'caption-' . str_replace( '_', '-', $att_id ); 1562 1565 1563 1566 $class = trim( 'wp-caption ' . $atts['align'] . ' ' . $atts['class'] ); … … 1591 1594 if ( $html5 ) { 1592 1595 $html = sprintf( 1593 '<figure %s%sclass="%s" >%s%s</figure>',1596 '<figure %s%sclass="%s" aria-describedby="%s">%s%s</figure>', 1594 1597 $atts['id'], 1595 1598 $style, 1596 1599 esc_attr( $class ), 1600 $caption_id, 1597 1601 do_shortcode( $content ), 1598 1602 sprintf( 1599 '<figcaption class="wp-caption-text">%s</figcaption>', 1603 '<figcaption id="%s" class="wp-caption-text">%s</figcaption>', 1604 $caption_id, 1600 1605 $atts['caption'] 1601 1606 ) … … 1607 1612 $style, 1608 1613 esc_attr( $class ), 1609 do_shortcode( $content),1614 str_replace( '<img ', '<img aria-describedby="' . $caption_id . '" ', do_shortcode( $content ) ), 1610 1615 sprintf( 1611 '<p class="wp-caption-text">%s</p>', 1616 '<p id="%s" class="wp-caption-text">%s</p>', 1617 $caption_id, 1612 1618 $atts['caption'] 1613 1619 )
Note: See TracChangeset
for help on using the changeset viewer.