WordPress.org

Make WordPress Core

Ticket #43123: 43123.diff

File 43123.diff, 1.7 KB (added by joemcgill, 20 months ago)
  • src/wp-includes/media.php

    diff --git src/wp-includes/media.php src/wp-includes/media.php
    index 8965da9ac2..614497a46b 100644
    function img_caption_shortcode( $attr, $content = null ) { 
    16031603
    16041604        $style = '';
    16051605        if ( $caption_width ) {
    1606                 $style = 'style="max-width: ' . (int) $caption_width . 'px" ';
     1606                $style = 'style="width: ' . (int) $caption_width . 'px" ';
    16071607        }
    16081608
    16091609        if ( $html5 ) {
  • tests/phpunit/tests/media.php

    diff --git tests/phpunit/tests/media.php tests/phpunit/tests/media.php
    index e55a4cea97..f2961b8355 100644
    CAP; 
    132132                $this->assertEquals( 1, preg_match_all( "/{$this->caption}/", $result, $_r ) );
    133133
    134134                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 ) );
    136136                } else {
    137                         $this->assertEquals( 1, preg_match_all( '/max-width: 30/', $result, $_r ) );
     137                        $this->assertEquals( 1, preg_match_all( '/width: 30/', $result, $_r ) );
    138138                }
    139139        }
    140140
  • tests/phpunit/tests/shortcode.php

    diff --git tests/phpunit/tests/shortcode.php tests/phpunit/tests/shortcode.php
    index 5acd7e268f..3577fab338 100644
    EOF; 
    535535                        ),
    536536                        array(
    537537                                '[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>',
    539539                        ),
    540540                        array(
    541541                                '<div [gallery]>',