From 0cf4b02a4fc2b69615fc3e86a2473e8c050fad6d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 9 Apr 2013 13:42:53 +0000 Subject: [PATCH] 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 --- wp-includes/media.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/media.php b/wp-includes/media.php index f62bc0b270..fed01799b8 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2045,7 +2045,7 @@ function get_the_post_format_media( $type, &$post = null ) { $count = 1; - if ( has_post_format( $type ) ) { + if ( has_post_format( $type, $post ) ) { $meta = get_post_format_meta( $post->ID ); if ( ! empty( $meta[$type] ) ) { if ( is_integer( $meta[$type] ) ) { @@ -2100,7 +2100,7 @@ function get_the_post_format_media( $type, &$post = null ) { return $post->format_content; } - $medias = call_user_func( 'get_attached_' . $type ); + $medias = call_user_func( 'get_attached_' . $type, $post->ID ); if ( ! empty( $medias ) ) { $media = reset( $medias ); $url = wp_get_attachment_url( $media->ID );