Ticket #18491: 18491_2.patch
| File 18491_2.patch, 1.8 KB (added by , 15 years ago) |
|---|
-
post-template.php
1153 1153 * @param string $text Optional, default is false. If string, then will be link text. 1154 1154 * @return string HTML content. 1155 1155 */ 1156 function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false) {1157 $id = intval( $id);1156 function wp_get_attachment_link( $id = 0, $size = 'thumbnail', $permalink = false, $icon = false, $text = false ) { 1157 $id = intval( $id ); 1158 1158 $_post = & get_post( $id ); 1159 1159 1160 if ( ('attachment' != $_post->post_type) || !$url = wp_get_attachment_url($_post->ID) )1161 return __( 'Missing Attachment');1160 if ( empty( $_post ) || ( 'attachment' != $_post->post_type ) || ! $url = wp_get_attachment_url( $_post->ID ) ) 1161 return __( 'Missing Attachment' ); 1162 1162 1163 1163 if ( $permalink ) 1164 $url = get_attachment_link( $_post->ID);1164 $url = get_attachment_link( $_post->ID ); 1165 1165 1166 $post_title = esc_attr( $_post->post_title);1166 $post_title = esc_attr( $_post->post_title ); 1167 1167 1168 if ( $text ) {1169 $link_text = esc_attr( $text);1170 } elseif ( ( is_int($size) && $size != 0 ) or ( is_string($size) && $size != 'none' ) or $size != false ) {1171 $link_text = wp_get_attachment_image( $id, $size, $icon);1172 } else {1168 if ( $text ) 1169 $link_text = esc_attr( $text ); 1170 elseif ( ( is_int( $size ) && $size != 0 ) || ( is_string( $size ) && $size != 'none' ) || $size != false ) 1171 $link_text = wp_get_attachment_image( $id, $size, $icon ); 1172 else 1173 1173 $link_text = ''; 1174 }1175 1174 1176 if ( trim($link_text) == '' )1175 if ( trim( $link_text ) == '' ) 1177 1176 $link_text = $_post->post_title; 1178 1177 1179 1178 return apply_filters( 'wp_get_attachment_link', "<a href='$url' title='$post_title'>$link_text</a>", $id, $size, $permalink, $icon, $text );
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)