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:
parent
cde6d602ea
commit
92467fbd63
|
@ -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>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue