Don't print links for unsupported file types in wp_video_shortcode()/wp_audio_shortcode(). Return them instead.

props SergeyBiryukov. fixes #24075.

git-svn-id: http://core.svn.wordpress.org/trunk@23988 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dominik Schilling 2013-04-14 10:33:44 +00:00
parent 1275da6ecd
commit f715505934

View File

@ -860,10 +860,8 @@ function wp_audio_shortcode( $attr ) {
$primary = false;
if ( ! empty( $src ) ) {
$type = wp_check_filetype( $src );
if ( ! in_array( $type['ext'], $default_types ) ) {
printf( '<a class="wp-post-format-link-audio" href="%1$s">%1$s</a>', $src );
return;
}
if ( ! in_array( $type['ext'], $default_types ) )
return sprintf( '<a class="wp-post-format-link-audio" href="%1$s">%1$s</a>', $src );
$primary = true;
array_unshift( $default_types, 'src' );
} else {
@ -967,10 +965,8 @@ function wp_video_shortcode( $attr ) {
$primary = false;
if ( ! empty( $src ) ) {
$type = wp_check_filetype( $src );
if ( ! in_array( $type['ext'], $default_types ) ) {
printf( '<a class="wp-post-format-link-video" href="%1$s">%1$s</a>', $src );
return;
}
if ( ! in_array( $type['ext'], $default_types ) )
return sprintf( '<a class="wp-post-format-link-video" href="%1$s">%1$s</a>', $src );
$primary = true;
array_unshift( $default_types, 'src' );
} else {