Changeset 23992 for trunk/wp-includes/media.php
- Timestamp:
- 04/14/2013 04:59:52 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/media.php
r23989 r23992 2401 2401 2402 2402 $meta = get_post_format_meta( $post->ID ); 2403 2404 $link_fmt = '%s'; 2405 if ( ! empty( $meta['url'] ) ) 2406 $link_fmt = '<a href="' . esc_url( $meta['url'] ) . '">%s</a>'; 2407 2403 2408 if ( ! empty( $meta['image'] ) ) { 2404 $post->format_content = wp_get_attachment_image( $meta['image'], $attached_size);2409 $post->format_content = sprintf( $link_fmt, wp_get_attachment_image( $meta['image'], $attached_size ) ); 2405 2410 return $post->format_content; 2406 2411 } … … 2413 2418 $urls = array(); 2414 2419 foreach ( $sizes as $size ) { 2415 $urls[] = reset( wp_get_attachment_image_src( $media->ID, $size ) ); 2416 $urls[] = get_attachment_link( $media->ID ); 2420 $image = wp_get_attachment_image_src( $media->ID, $size ); 2421 if ( $image ) { 2422 $urls[] = reset( $image ); 2423 $urls[] = get_attachment_link( $media->ID ); 2424 } 2417 2425 } 2418 2426 … … 2444 2452 2445 2453 $post->split_content = $content; 2446 $post->format_content = wp_get_attachment_image( $media->ID, $attached_size ); 2454 $image = wp_get_attachment_image( $media->ID, $attached_size ); 2455 $post->format_content = sprintf( $link_fmt, $image ); 2447 2456 return $post->format_content; 2448 2457 } … … 2453 2462 $html = reset( $htmls ); 2454 2463 $post->split_content = $content; 2455 $post->format_content = $html;2464 $post->format_content = sprintf( $link_fmt, $html ); 2456 2465 return $post->format_content; 2457 2466 }
Note: See TracChangeset
for help on using the changeset viewer.