Make WordPress Core

Ticket #43185: 43185.diff

File 43185.diff, 1.0 KB (added by jainnidhi, 7 years ago)
  • wp-includes/media.php

    diff --git a/wp-includes/media.php b/wp-includes/media.php
    index 1e6a4e5..dbd1766 100644
    a b function img_caption_shortcode( $attr, $content = null ) { 
    15881588                $style = 'style="max-width: ' . (int) $caption_width . 'px" ';
    15891589        }
    15901590
     1591        /**
     1592        * Filters the style of an image's caption.
     1593        *
     1594        * @see img_caption_shortcode()
     1595        *
     1596        * @param string $style    the default style attribute
     1597        * @param int    $width    Width of the caption in pixels. To remove this inline style,
     1598        *                         return zero.
     1599        * @param array  $atts     Attributes of the caption shortcode.
     1600        * @param string $content  The image element, possibly wrapped in a hyperlink.
     1601        */
     1602
     1603        $style = apply_filters( 'img_caption_shortcode_style', $style, $width, $atts, $content );
     1604
    15911605        if ( $html5 ) {
    15921606                $html = '<figure ' . $atts['id'] . $style . 'class="' . esc_attr( $class ) . '">'
    15931607                . do_shortcode( $content ) . '<figcaption class="wp-caption-text">' . $atts['caption'] . '</figcaption></figure>';