Fix issue with [embed] in post_format_compat.
props kovshenin. fixes #24070. git-svn-id: http://core.svn.wordpress.org/trunk@24083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
759b3f5e82
commit
254ea5ad54
|
@ -1365,9 +1365,7 @@ function wp_embed_handler_googlevideo( $matches, $attr, $url, $rawattr ) {
|
||||||
* @return string The embed HTML.
|
* @return string The embed HTML.
|
||||||
*/
|
*/
|
||||||
function wp_embed_handler_audio( $matches, $attr, $url, $rawattr ) {
|
function wp_embed_handler_audio( $matches, $attr, $url, $rawattr ) {
|
||||||
$audio = $url;
|
$audio = sprintf( '[audio src="%s" /]', esc_url( $url ) );
|
||||||
if ( shortcode_exists( 'audio' ) )
|
|
||||||
$audio = do_shortcode( '[audio src="' . $url . '" /]' );
|
|
||||||
return apply_filters( 'wp_embed_handler_audio', $audio, $attr, $url, $rawattr );
|
return apply_filters( 'wp_embed_handler_audio', $audio, $attr, $url, $rawattr );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1384,8 +1382,6 @@ function wp_embed_handler_audio( $matches, $attr, $url, $rawattr ) {
|
||||||
*/
|
*/
|
||||||
function wp_embed_handler_video( $matches, $attr, $url, $rawattr ) {
|
function wp_embed_handler_video( $matches, $attr, $url, $rawattr ) {
|
||||||
$dimensions = '';
|
$dimensions = '';
|
||||||
$video = $url;
|
|
||||||
if ( shortcode_exists( 'video' ) ) {
|
|
||||||
if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) {
|
if ( ! empty( $rawattr['width'] ) && ! empty( $rawattr['height'] ) ) {
|
||||||
$dimensions .= sprintf( 'width="%d" ', (int) $rawattr['width'] );
|
$dimensions .= sprintf( 'width="%d" ', (int) $rawattr['width'] );
|
||||||
$dimensions .= sprintf( 'height="%d" ', (int) $rawattr['height'] );
|
$dimensions .= sprintf( 'height="%d" ', (int) $rawattr['height'] );
|
||||||
|
@ -1399,8 +1395,8 @@ function wp_embed_handler_video( $matches, $attr, $url, $rawattr ) {
|
||||||
$dimensions .= sprintf( 'height="%d" ', (int) $meta['height'] );
|
$dimensions .= sprintf( 'height="%d" ', (int) $meta['height'] );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$video = do_shortcode( '[video ' . $dimensions . 'src="' . $url . '" /]' );
|
|
||||||
}
|
$video = sprintf( '[video %s src="%s" /]', $dimensions, esc_url( $url ) );
|
||||||
return apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr );
|
return apply_filters( 'wp_embed_handler_video', $video, $attr, $url, $rawattr );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue