Make WordPress Core


Ignore:
Timestamp:
07/03/2013 08:43:19 PM (12 years ago)
Author:
nacin
Message:

Allow gallery to be inserted with no links on the images. props chipbennett, helgatheviking, aaroncampbell, wonderboymusic. fixes #18178.

File:
1 edited

Legend:

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

    r24548 r24550  
    779779    $i = 0;
    780780    foreach ( $attachments as $id => $attachment ) {
    781         $link = isset($attr['link']) && 'file' == $attr['link'] ? wp_get_attachment_link($id, $size, false, false) : wp_get_attachment_link($id, $size, true, false);
     781        if ( ! empty( $attr['link'] ) && 'file' === $attr['link'] )
     782            $image_output = wp_get_attachment_link( $id, $size, false, false );
     783        elseif ( ! empty( $attr['link'] ) && 'none' === $attr['link'] )
     784            $image_output = wp_get_attachment_image( $id, $size, false );
     785        else
     786            $image_output = wp_get_attachment_link( $id, $size, true, false );
     787
    782788        $image_meta  = wp_get_attachment_metadata( $id );
    783789
     
    789795        $output .= "
    790796            <{$icontag} class='gallery-icon {$orientation}'>
    791                 $link
     797                $image_output
    792798            </{$icontag}>";
    793799        if ( $captiontag && trim($attachment->post_excerpt) ) {
Note: See TracChangeset for help on using the changeset viewer.