Make WordPress Core

Ticket #33277: patch.diff

File patch.diff, 1.3 KB (added by several27, 10 years ago)
  • post-template.php

     
    15561556 *
    15571557 * @since 2.5.0
    15581558 *
    1559  * @param int|WP_Post  $id        Optional. Post ID or post object.
     1559 * @param int          $id        Optional. Post ID or post object.
    15601560 * @param string       $size      Optional, default is 'thumbnail'. Size of image, either array or string.
    15611561 * @param bool         $permalink Optional, default is false. Whether to add permalink to image.
    15621562 * @param bool         $icon      Optional, default is false. Whether to include icon.
     
    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        }