Make WordPress Core


Ignore:
Timestamp:
07/16/2020 09:29:05 PM (4 years ago)
Author:
whyisjake
Message:

Feeds: Ensure that galleries can be output as a list of links in feeds.

Adjusts the gallery shortcode handler to check for the link attribute when outputting to a feed.

Fixes #22101.

Props ifrins, mdgl, SergeyBiryukov, chriscct7, stevenkword, iworks, DrewAPicture, birgire, whyisjake.

File:
1 edited

Legend:

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

    r48454 r48496  
    22512251        $output = "\n";
    22522252        foreach ( $attachments as $att_id => $attachment ) {
    2253             $output .= wp_get_attachment_link( $att_id, $atts['size'], true ) . "\n";
     2253            if ( ! empty( $atts['link'] ) ) {
     2254                if ( 'none' === $atts['link'] ) {
     2255                    $output .= wp_get_attachment_image( $att_id, $atts['size'], false, $attr );
     2256                } else {
     2257                    $output .= wp_get_attachment_link( $att_id, $atts['size'], false );
     2258                }
     2259            } else {
     2260                $output .= wp_get_attachment_link( $att_id, $atts['size'], true );
     2261            }
     2262            $output .= "\n";
    22542263        }
    22552264        return $output;
Note: See TracChangeset for help on using the changeset viewer.