Make WordPress Core


Ignore:
Timestamp:
10/04/2017 02:49:19 AM (7 years ago)
Author:
joemcgill
Message:

Media: Use max-width for default captions.

This alters the HTML output of the image caption shortcode to use
max-width instead of width to improve compatibility with
flexible layouts.

Props aaronrutley, desrosj.
Fixes #33981.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/media.php

    r41383 r41724  
    15791579    $style = '';
    15801580    if ( $caption_width ) {
    1581         $style = 'style="width: ' . (int) $caption_width . 'px" ';
     1581        $style = 'style="max-width: ' . (int) $caption_width . 'px" ';
    15821582    }
    15831583
Note: See TracChangeset for help on using the changeset viewer.