diff --git src/wp-includes/media.php src/wp-includes/media.php
index 8965da9ac2..614497a46b 100644
|
|
|
function img_caption_shortcode( $attr, $content = null ) { |
| 1603 | 1603 | |
| 1604 | 1604 | $style = ''; |
| 1605 | 1605 | if ( $caption_width ) { |
| 1606 | | $style = 'style="max-width: ' . (int) $caption_width . 'px" '; |
| | 1606 | $style = 'style="width: ' . (int) $caption_width . 'px" '; |
| 1607 | 1607 | } |
| 1608 | 1608 | |
| 1609 | 1609 | if ( $html5 ) { |
diff --git tests/phpunit/tests/media.php tests/phpunit/tests/media.php
index e55a4cea97..f2961b8355 100644
|
|
|
CAP; |
| 132 | 132 | $this->assertEquals( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) ); |
| 133 | 133 | |
| 134 | 134 | if ( current_theme_supports( 'html5', 'caption' ) ) { |
| 135 | | $this->assertEquals( 1, preg_match_all( '/max-width: 20/', $result, $_r ) ); |
| | 135 | $this->assertEquals( 1, preg_match_all( '/width: 20/', $result, $_r ) ); |
| 136 | 136 | } else { |
| 137 | | $this->assertEquals( 1, preg_match_all( '/max-width: 30/', $result, $_r ) ); |
| | 137 | $this->assertEquals( 1, preg_match_all( '/width: 30/', $result, $_r ) ); |
| 138 | 138 | } |
| 139 | 139 | } |
| 140 | 140 | |
diff --git tests/phpunit/tests/shortcode.php tests/phpunit/tests/shortcode.php
index 5acd7e268f..3577fab338 100644
|
|
|
EOF; |
| 535 | 535 | ), |
| 536 | 536 | array( |
| 537 | 537 | '[caption caption="test" width="2"]<div>hello</div>[/caption]', |
| 538 | | '<div style="max-width: 12px" class="wp-caption alignnone"><div>hello</div><p class="wp-caption-text">test</p></div>', |
| | 538 | '<div style="width: 12px" class="wp-caption alignnone"><div>hello</div><p class="wp-caption-text">test</p></div>', |
| 539 | 539 | ), |
| 540 | 540 | array( |
| 541 | 541 | '<div [gallery]>', |