WordPress.org

Make WordPress Core

Changeset 24550


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

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

Location:
trunk/wp-includes
Files:
2 edited

Legend:

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

    r24320 r24550  
    354354                    <?php esc_attr_e('Media File'); ?>
    355355                </option>
     356                <option value="none">
     357                    <?php esc_attr_e('None'); ?>
     358                </option>
    356359            </select>
    357360        </label>
  • 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.