When a video shortcode has content in its body, append it as inner HTML in the resulting `<video>`.

Reverts [27096].
Fixes #26628.
See #27016.


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


git-svn-id: http://core.svn.wordpress.org/trunk@26968 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2014-02-05 01:43:12 +00:00
parent 5e08452f49
commit 228fc639b9
2 changed files with 10 additions and 2 deletions

View File

@ -3584,8 +3584,8 @@ function normalize_whitespace( $str ) {
/**
* Properly strip all HTML tags including script and style
*
* This differs from strip_tags() because it removes the contents of
*
* This differs from strip_tags() because it removes the contents of
* the <script> and <style> tags. E.g. strip_tags( '<script>something</script>' )
* will return 'something'. wp_strip_all_tags will return ''
*

View File

@ -1233,6 +1233,14 @@ function wp_video_shortcode( $attr, $content = '' ) {
$html .= sprintf( $source, $type['type'], esc_url( $$fallback ) );
}
}
if ( ! empty( $content ) ) {
if ( false !== strpos( $content, "\n" ) )
$content = str_replace( array( "\r\n", "\n", "\t" ), '', $content );
$html .= trim( $content );
}
if ( 'mediaelement' === $library )
$html .= wp_mediaelement_fallback( $fileurl );
$html .= '</video>';