mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 02:10:45 +01:00
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:
parent
8bda27e12c
commit
0cf4b02a4f
@ -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 );
|
||||
|
Loading…
Reference in New Issue
Block a user