Ticket #49601: 49601-2.diff
File 49601-2.diff, 1.2 KB (added by , 5 years ago) |
---|
-
src/wp-includes/media.php
1786 1786 $style = ''; 1787 1787 1788 1788 if ( $caption_width ) { 1789 $style = 'style=" width: ' . (int) $caption_width . 'px" ';1789 $style = 'style="max-width: ' . (int) $caption_width . 'px" '; 1790 1790 } 1791 1791 1792 1792 if ( $html5 ) { 1793 1793 $html = sprintf( 1794 '<figure %s%s %sclass="%s">%s%s</figure>',1794 '<figure %s%sclass="%s">%s%s</figure>', 1795 1795 $id, 1796 1796 $describedby, 1797 $style,1798 1797 esc_attr( $class ), 1799 1798 do_shortcode( $content ), 1800 1799 sprintf( 1801 '<figcaption %s class="wp-caption-text">%s</figcaption>',1800 '<figcaption %s%sclass="wp-caption-text">%s</figcaption>', 1802 1801 $caption_id, 1802 $style, 1803 1803 $atts['caption'] 1804 1804 ) 1805 1805 ); 1806 1806 } else { 1807 1807 $html = sprintf( 1808 '<div %s %sclass="%s">%s%s</div>',1808 '<div %sclass="%s">%s%s</div>', 1809 1809 $id, 1810 $style,1811 1810 esc_attr( $class ), 1812 1811 str_replace( '<img ', '<img ' . $describedby, do_shortcode( $content ) ), 1813 1812 sprintf( 1814 '<p %s class="wp-caption-text">%s</p>',1813 '<p %s%sclass="wp-caption-text">%s</p>', 1815 1814 $caption_id, 1815 $style, 1816 1816 $atts['caption'] 1817 1817 ) 1818 1818 );