Ticket #33277: patch.diff
File patch.diff, 1.3 KB (added by , 10 years ago) |
---|
-
post-template.php
1556 1556 * 1557 1557 * @since 2.5.0 1558 1558 * 1559 * @param int |WP_Post$id Optional. Post ID or post object.1559 * @param int $id Optional. Post ID or post object. 1560 1560 * @param string $size Optional, default is 'thumbnail'. Size of image, either array or string. 1561 1561 * @param bool $permalink Optional, default is false. Whether to add permalink to image. 1562 1562 * @param bool $icon Optional, default is false. Whether to include icon. … … 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 }