Make WordPress Core

Ticket #27634: 27634.patch

File 27634.patch, 1.3 KB (added by ocean90, 11 years ago)
  • src/wp-includes/post-template.php

     
    14531453        if ( empty($post->post_type) || $post->post_type != 'attachment' )
    14541454                return $content;
    14551455
    1456         if ( wp_attachment_is_image() ) {
    1457                 $p = '<p class="attachment">';
    1458                 // show the medium sized image representation of the attachment if available, and link to the raw file
    1459                 $p .= wp_get_attachment_link(0, 'medium', false);
    1460                 $p .= '</p>';
    1461         } elseif ( 0 === strpos( $post->post_mime_type, 'video' ) ) {
     1456        if ( 0 === strpos( $post->post_mime_type, 'video' ) ) {
    14621457                $meta = wp_get_attachment_metadata( get_the_ID() );
    14631458                $atts = array( 'src' => wp_get_attachment_url() );
    14641459                if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) {
     
    14681463                $p = wp_video_shortcode( $atts );
    14691464        } elseif ( 0 === strpos( $post->post_mime_type, 'audio' ) ) {
    14701465                $p = wp_audio_shortcode( array( 'src' => wp_get_attachment_url() ) );
     1466        } else {
     1467                $p = '<p class="attachment">';
     1468                // show the medium sized image representation of the attachment if available, and link to the raw file
     1469                $p .= wp_get_attachment_link( 0, 'medium', false );
     1470                $p .= '</p>';
    14711471        }
    14721472
    14731473        /**