WordPress.org

Make WordPress Core

Ticket #9036: media-links-upgrade-2-6.patch

File media-links-upgrade-2-6.patch, 1019 bytes (added by noel, 9 years ago)

2/6/2009 9:03pm

  • wp-includes/post-template.php

     
    926926
    927927        $post_title = attribute_escape($_post->post_title);
    928928       
    929         if ( $text ) {
     929        if( $text ) {
    930930                $link_text = attribute_escape($text);
    931         } elseif ( ( is_int($size) && $size != 0 ) or ( is_string($size) && $size != 'none' ) or $size != false ) {
     931        } elseif( ( is_int($size) && $size != 0 ) or ( is_string($size) && $size != 'none' ) or $size != false ) {
    932932                $link_text = wp_get_attachment_image($id, $size, $icon);
    933         } else {
     933        }
     934
     935        if( trim($link_text) == '' )
    934936                $link_text = $_post->post_title;
    935         }
    936937       
    937         return apply_filters( 'wp_get_attachment_link', "<a href='$url' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon );
     938        return apply_filters( 'wp_get_attachment_link', "<a href='$url' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text );
    938939}
    939940
    940941/**