Make WordPress Core

Ticket #38100: 38100.diff

File 38100.diff, 1.2 KB (added by mbelchev, 5 years ago)
  • src/wp-includes/media.php

     
    17921792                        <{$icontag} class='gallery-icon {$orientation}'>
    17931793                                $image_output
    17941794                        </{$icontag}>";
    1795                 if ( $captiontag && trim($attachment->post_excerpt) ) {
     1795                if ( $captiontag && trim( $attachment->post_excerpt ) ) {
     1796                        /**
     1797                         * Filters the gallery attachments caption.
     1798                         *
     1799                         * Filter that can be used for extend, edit, reformat and etc. the caption of certain attachment in a gallery.
     1800                         * The filter "id" argument gives you the opportunity to select specific attachment in the gallery.
     1801                         *
     1802                         * @since 5.1
     1803                         *
     1804                         * @param string        $attachment->post_excerpt       Contains the caption value entered via the media library.
     1805                         * @param int           $id                                             Contains the post ID of the attachment.
     1806                         */
     1807                        $gallery_caption = wptexturize( apply_filters( 'gallery_caption', $attachment->post_excerpt, $id ) );
     1808
    17961809                        $output .= "
    17971810                                <{$captiontag} class='wp-caption-text gallery-caption' id='$selector-$id'>
    1798                                 " . wptexturize($attachment->post_excerpt) . "
     1811                                " . $gallery_caption . "
    17991812                                </{$captiontag}>";
    18001813                }
    18011814                $output .= "</{$itemtag}>";