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.


Built from https://develop.svn.wordpress.org/trunk@27908


git-svn-id: http://core.svn.wordpress.org/trunk@27739 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-04-02 17:14:15 +00:00
parent cde6d602ea
commit 92467fbd63
1 changed files with 6 additions and 6 deletions

View File

@ -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 = '<p class="attachment">';
// 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 .= '</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 = '<p class="attachment">';
// 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 .= '</p>';
}
/**