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: https://develop.svn.wordpress.org/trunk@23988 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e0bc9ec705
commit
c907f0f4a7
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user