WordPress.org

Make WordPress Core


Ignore:
Timestamp:
10/10/2012 09:54:21 PM (9 years ago)
Author:
koopersmith
Message:

Correctly insert non-image attachments as links.

  • Adds wp.media.string.link( attachment ) for printing attachment links.
  • Adds the link attribute to Attachment models that corresponds to the link to the attachment post.

see #21390, #21836.

File:
1 edited

Legend:

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

    r22160 r22170  
    12471247        'filename'    => basename( $attachment->guid ),
    12481248        'url'         => $attachment_url,
     1249        'link'        => get_attachment_link( $attachment->ID ),
    12491250        'alt'         => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
    12501251        'author'      => $attachment->post_author,
Note: See TracChangeset for help on using the changeset viewer.