Audio/Video shortcodes in the media modal:
* Add `embedMimes` to `_wpMediaViewsL10n` * Use `escape` instead of `interpolate` when setting attributes in Underscore templates * When creating the `<audio>` and `<video>` tags dynamically, set inner `<source>` nodes instead of the `src` attribute and properly set the mime-type per source as the `type` attribute. This is also drastically reduces the amount of code used to generate the tags. See #27016. Built from https://develop.svn.wordpress.org/trunk@27476 git-svn-id: http://core.svn.wordpress.org/trunk@27320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -2342,6 +2342,18 @@ function wp_enqueue_media( $args = array() ) {
|
||||
'size' => get_option( 'image_default_size' ), // empty default
|
||||
);
|
||||
|
||||
$exts = array_merge( wp_get_audio_extensions(), wp_get_video_extensions() );
|
||||
$mimes = get_allowed_mime_types();
|
||||
$ext_mimes = array();
|
||||
foreach ( $exts as $ext ) {
|
||||
foreach ( $mimes as $ext_preg => $mime_match ) {
|
||||
if ( preg_match( '#' . $ext . '#i', $ext_preg ) ) {
|
||||
$ext_mimes[ $ext ] = $mime_match;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$settings = array(
|
||||
'tabs' => $tabs,
|
||||
'tabUrl' => add_query_arg( array( 'chromeless' => true ), admin_url('media-upload.php') ),
|
||||
@@ -2354,7 +2366,8 @@ function wp_enqueue_media( $args = array() ) {
|
||||
'id' => 0,
|
||||
),
|
||||
'defaultProps' => $props,
|
||||
'embedExts' => array_merge( wp_get_audio_extensions(), wp_get_video_extensions() ),
|
||||
'embedExts' => $exts,
|
||||
'embedMimes' => $ext_mimes
|
||||
);
|
||||
|
||||
$post = null;
|
||||
|
||||
Reference in New Issue
Block a user