WordPress.org

Make WordPress Core

Ticket #24003: 24003.diff

File 24003.diff, 711 bytes (added by kovshenin, 5 years ago)
  • wp-includes/media.php

     
    20452045
    20462046        $count = 1;
    20472047
    2048         if ( has_post_format( $type ) ) {
     2048        if ( has_post_format( $type, $post ) ) {
    20492049                $meta = get_post_format_meta( $post->ID );
    20502050                if ( ! empty( $meta[$type] ) ) {
    20512051                        if ( is_integer( $meta[$type] ) ) {
     
    21002100                return $post->format_content;
    21012101        }
    21022102
    2103         $medias = call_user_func( 'get_attached_' . $type );
     2103        $medias = call_user_func( 'get_attached_' . $type, $post->ID );
    21042104        if ( ! empty( $medias ) ) {
    21052105                $media = reset( $medias );
    21062106                $url = wp_get_attachment_url( $media->ID );