Ticket #23964: 23964.2.diff
File 23964.2.diff, 2.5 KB (added by , 12 years ago) |
---|
-
wp-includes/media.php
function get_the_post_format_image( $attached_size = 'full', &$post = null ) { 2385 2385 return $post->format_content; 2386 2386 2387 2387 $meta = get_post_format_meta( $post->ID ); 2388 2389 $link_fmt = '%s'; 2390 if ( ! empty( $meta['url'] ) ) 2391 $link_fmt = '<a href="' . esc_url( $meta['url'] ) . '">%s</a>'; 2392 2388 2393 if ( ! empty( $meta['image'] ) ) { 2389 $post->format_content = wp_get_attachment_image( $meta['image'], $attached_size);2394 $post->format_content = sprintf( $link_fmt, wp_get_attachment_image( $meta['image'], $attached_size ) ); 2390 2395 return $post->format_content; 2391 2396 } 2392 2397 … … function get_the_post_format_image( $attached_size = 'full', &$post = null ) { 2397 2402 2398 2403 $urls = array(); 2399 2404 foreach ( $sizes as $size ) { 2400 $urls[] = reset( wp_get_attachment_image_src( $media->ID, $size ) ); 2401 $urls[] = get_attachment_link( $media->ID ); 2405 $image = wp_get_attachment_image_src( $media->ID, $size ); 2406 if ( $image ) { 2407 $urls[] = reset( $image ); 2408 $urls[] = get_attachment_link( $media->ID ); 2409 } 2402 2410 } 2403 2411 2404 2412 $count = 1; … … function get_the_post_format_image( $attached_size = 'full', &$post = null ) { 2428 2436 } 2429 2437 2430 2438 $post->split_content = $content; 2431 $post->format_content = wp_get_attachment_image( $media->ID, $attached_size ); 2439 $image = wp_get_attachment_image( $media->ID, $attached_size ); 2440 $post->format_content = sprintf( $link_fmt, $image ); 2432 2441 return $post->format_content; 2433 2442 } 2434 2443 … … function get_the_post_format_image( $attached_size = 'full', &$post = null ) { 2437 2446 if ( ! empty( $htmls ) ) { 2438 2447 $html = reset( $htmls ); 2439 2448 $post->split_content = $content; 2440 $post->format_content = $html;2449 $post->format_content = sprintf( $link_fmt, $html ); 2441 2450 return $post->format_content; 2442 2451 } 2443 2452 } -
wp-includes/post-formats.php
function get_the_post_format_url( $id = 0 ) { 707 707 if ( empty( $post ) ) 708 708 return ''; 709 709 710 if ( in_array( get_post_format( $post->ID ), array( ' link', 'quote' ) ) ) {710 if ( in_array( get_post_format( $post->ID ), array( 'image', 'link', 'quote' ) ) ) { 711 711 $meta = get_post_format_meta( $post->ID ); 712 712 if ( ! empty( $meta['url'] ) ) 713 713 return apply_filters( 'get_the_post_format_url', esc_url_raw( $meta['url'] ), $post );