Make WordPress Core

Ticket #33277: patch.2.diff

File patch.2.diff, 809 bytes (added by several27, 10 years ago)
  • post-template.php

     
    15651565 * @return string HTML content.
    15661566 */
    15671567function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false, $attr = '' ) {
    1568         $id = intval( $id );
    15691568        $_post = get_post( $id );
    15701569
    15711570        if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) )
     
    15771576        if ( $text ) {
    15781577                $link_text = $text;
    15791578        } 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 );
    15811580        } else {
    15821581                $link_text = '';
    15831582        }