Ticket #33277: patch.2.diff
File patch.2.diff, 809 bytes (added by , 10 years ago) |
---|
-
post-template.php
1565 1565 * @return string HTML content. 1566 1566 */ 1567 1567 function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false, $attr = '' ) { 1568 $id = intval( $id );1569 1568 $_post = get_post( $id ); 1570 1569 1571 1570 if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) ) … … 1577 1576 if ( $text ) { 1578 1577 $link_text = $text; 1579 1578 } elseif ( $size && 'none' != $size ) { 1580 $link_text = wp_get_attachment_image( $ id, $size, $icon, $attr );1579 $link_text = wp_get_attachment_image( $_post->ID, $size, $icon, $attr ); 1581 1580 } else { 1582 1581 $link_text = ''; 1583 1582 }