Ticket #24458: 24458.3.diff
File 24458.3.diff, 3.2 KB (added by , 12 years ago) |
---|
-
wp-includes/js/media-editor.js
100 100 var shortcode, html; 101 101 102 102 props = wp.media.string.props( props, attachment ); 103 103 104 shortcode = {}; 104 105 105 if ( props.mime ) { 106 switch ( props.mime ) { 107 case 'audio/mpeg': 108 if ( attachment.url.indexOf( 'mp3' ) ) 109 shortcode.mp3 = attachment.url; 110 else if ( attachment.url.indexOf( 'm4a' ) ) 111 shortcode.m4a = attachment.url; 112 break; 113 case 'audio/mp3': 114 shortcode.mp3 = attachment.url; 115 break; 116 case 'audio/m4a': 117 shortcode.m4a = attachment.url; 118 break; 119 case 'audio/wav': 120 shortcode.wav = attachment.url; 121 break; 122 case 'audio/ogg': 123 shortcode.ogg = attachment.url; 124 break; 125 case 'audio/x-ms-wma': 126 case 'audio/wma': 127 shortcode.wma = attachment.url; 128 break; 129 } 130 } 106 shortcode.id = attachment.id; 131 107 132 108 html = wp.shortcode.string({ 133 109 tag: 'audio', … … 144 120 145 121 shortcode = {}; 146 122 123 shortcode.id = attachment.id; 124 147 125 if ( attachment.width ) 148 126 shortcode.width = attachment.width; 149 127 150 128 if ( attachment.height ) 151 129 shortcode.height = attachment.height; 152 130 153 if ( props.mime ) {154 switch ( props.mime ) {155 case 'video/mp4':156 shortcode.mp4 = attachment.url;157 break;158 case 'video/m4v':159 shortcode.m4v = attachment.url;160 break;161 case 'video/webm':162 shortcode.webm = attachment.url;163 break;164 case 'video/ogg':165 shortcode.ogv = attachment.url;166 break;167 case 'video/x-ms-wmv':168 case 'video/wmv':169 case 'video/asf':170 shortcode.wmv = attachment.url;171 break;172 case 'video/flv':173 case 'video/x-flv':174 shortcode.flv = attachment.url;175 break;176 }177 }178 179 131 html = wp.shortcode.string({ 180 132 tag: 'video', 181 133 attrs: shortcode -
wp-includes/media.php
function wp_audio_shortcode( $attr ) { 850 850 $audio = null; 851 851 852 852 $default_types = wp_get_audio_extensions(); 853 $defaults_atts = array( 'src' => '' ); 853 $defaults_atts = array( 854 'src' => '', 855 'id' => '' 856 ); 854 857 foreach ( $default_types as $type ) 855 858 $defaults_atts[$type] = ''; 856 859 857 860 $atts = shortcode_atts( $defaults_atts, $attr, 'audio' ); 858 861 extract( $atts ); 859 862 863 if ( $id ) // if 'id' is set, use that, and ignore 'src' 864 $src = wp_get_attachment_url( $id ); 865 860 866 $primary = false; 861 867 if ( ! empty( $src ) ) { 862 868 $type = wp_check_filetype( $src ); … … function wp_video_shortcode( $attr ) { 952 958 $default_types = wp_get_video_extensions(); 953 959 $defaults_atts = array( 954 960 'src' => '', 961 'id' => '', 955 962 'poster' => '', 956 963 'height' => 360, 957 964 'width' => empty( $content_width ) ? 640 : $content_width, … … function wp_video_shortcode( $attr ) { 963 970 $atts = shortcode_atts( $defaults_atts, $attr, 'video' ); 964 971 extract( $atts ); 965 972 973 if ( $id ) // if 'id' is set, use that, and ignore 'src' 974 $src = wp_get_attachment_url( $id ); 975 966 976 $w = $width; 967 977 $h = $height; 968 978 if ( is_admin() && $width > 600 )