mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 22:30:04 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@48496 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2250,7 +2250,16 @@ function gallery_shortcode( $attr ) {
|
||||
if ( is_feed() ) {
|
||||
$output = "\n";
|
||||
foreach ( $attachments as $att_id => $attachment ) {
|
||||
$output .= wp_get_attachment_link( $att_id, $atts['size'], true ) . "\n";
|
||||
if ( ! empty( $atts['link'] ) ) {
|
||||
if ( 'none' === $atts['link'] ) {
|
||||
$output .= wp_get_attachment_image( $att_id, $atts['size'], false, $attr );
|
||||
} else {
|
||||
$output .= wp_get_attachment_link( $att_id, $atts['size'], false );
|
||||
}
|
||||
} else {
|
||||
$output .= wp_get_attachment_link( $att_id, $atts['size'], true );
|
||||
}
|
||||
$output .= "\n";
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user