Consistently use the function argument instead of the $post global in get_the_post_format_media(). props kovshenin. fixes #24003.

git-svn-id: http://core.svn.wordpress.org/trunk@23937 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2013-04-09 13:42:53 +00:00
parent 8bda27e12c
commit 0cf4b02a4f
1 changed files with 2 additions and 2 deletions

View File

@ -2045,7 +2045,7 @@ function get_the_post_format_media( $type, &$post = null ) {
$count = 1; $count = 1;
if ( has_post_format( $type ) ) { if ( has_post_format( $type, $post ) ) {
$meta = get_post_format_meta( $post->ID ); $meta = get_post_format_meta( $post->ID );
if ( ! empty( $meta[$type] ) ) { if ( ! empty( $meta[$type] ) ) {
if ( is_integer( $meta[$type] ) ) { if ( is_integer( $meta[$type] ) ) {
@ -2100,7 +2100,7 @@ function get_the_post_format_media( $type, &$post = null ) {
return $post->format_content; return $post->format_content;
} }
$medias = call_user_func( 'get_attached_' . $type ); $medias = call_user_func( 'get_attached_' . $type, $post->ID );
if ( ! empty( $medias ) ) { if ( ! empty( $medias ) ) {
$media = reset( $medias ); $media = reset( $medias );
$url = wp_get_attachment_url( $media->ID ); $url = wp_get_attachment_url( $media->ID );