From f17d9491b189bd25161ac0132ba70e524e51d0c1 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Wed, 2 Apr 2014 17:13:09 +0000 Subject: [PATCH] Fix a regression caused by [27622] in `prepend_attachment()` by passing all attachments that are not audio or video to the `else` clause. Fixes #27634. git-svn-id: https://develop.svn.wordpress.org/trunk@27908 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/post-template.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/wp-includes/post-template.php b/src/wp-includes/post-template.php index dfc74f6ce0..be462587a2 100644 --- a/src/wp-includes/post-template.php +++ b/src/wp-includes/post-template.php @@ -1453,12 +1453,7 @@ function prepend_attachment($content) { if ( empty($post->post_type) || $post->post_type != 'attachment' ) return $content; - if ( wp_attachment_is_image() ) { - $p = '

'; - // show the medium sized image representation of the attachment if available, and link to the raw file - $p .= wp_get_attachment_link(0, 'medium', false); - $p .= '

'; - } elseif ( 0 === strpos( $post->post_mime_type, 'video' ) ) { + if ( 0 === strpos( $post->post_mime_type, 'video' ) ) { $meta = wp_get_attachment_metadata( get_the_ID() ); $atts = array( 'src' => wp_get_attachment_url() ); if ( ! empty( $meta['width'] ) && ! empty( $meta['height'] ) ) { @@ -1468,6 +1463,11 @@ function prepend_attachment($content) { $p = wp_video_shortcode( $atts ); } elseif ( 0 === strpos( $post->post_mime_type, 'audio' ) ) { $p = wp_audio_shortcode( array( 'src' => wp_get_attachment_url() ) ); + } else { + $p = '

'; + // show the medium sized image representation of the attachment if available, and link to the raw file + $p .= wp_get_attachment_link(0, 'medium', false); + $p .= '

'; } /**