Ticket #24505: 24505.diff
| File 24505.diff, 3.1 KB (added by , 13 years ago) |
|---|
-
wp-admin/includes/media.php
2359 2359 <?php 2360 2360 elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'audio/' ) ): 2361 2361 2362 echo do_shortcode( '[audio src="' . $att_url . '"]');2362 echo wp_audio_shortcode( array( 'src' => $att_url ) ); 2363 2363 2364 2364 elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'video/' ) ): 2365 2365 … … 2371 2371 if ( $h && $w < $meta['width'] ) 2372 2372 $h = round( ( $meta['height'] * $w ) / $meta['width'] ); 2373 2373 2374 $shortcode = sprintf( '[video src="%s"%s%s]', 2375 $att_url, 2376 empty( $meta['width'] ) ? '' : sprintf( ' width="%d"', $w ), 2377 empty( $meta['height'] ) ? '' : sprintf( ' height="%d"', $h ) 2378 ); 2379 echo do_shortcode( $shortcode ); 2374 $attr = array( 'src' => $att_url ); 2380 2375 2376 if ( ! empty( $meta['width' ] ) ) 2377 $attr['width'] = $w; 2378 2379 if ( ! empty( $meta['height'] ) ) 2380 $attr['height'] = $h; 2381 2382 echo wp_video_shortcode( $attr ); 2383 2381 2384 endif; ?> 2382 2385 </div> 2383 2386 <div class="wp_attachment_details edit-form-section"> -
wp-includes/media.php
2070 2070 $embed = reset( $embeds ); 2071 2071 if ( 0 === strpos( $embed, 'http' ) ) { 2072 2072 if ( strstr( $embed, home_url() ) ) { 2073 $post->format_content[ $cache_key ] = do_shortcode( sprintf( '[%s src="%s"]', $type, $embed ) ); 2073 2074 $format_content = ''; 2075 $attr = array( 'src' => $embed ); 2076 2077 if ( 'audio' == $type ) 2078 $format_content = wp_audio_shortcode( $attr ); 2079 elseif ( 'video' == $type ) 2080 $format_content = wp_video_shortcode( $attr ); 2081 2082 $post->format_content[ $cache_key ] = $format_content; 2074 2083 } else { 2075 2084 $post->format_content[ $cache_key ] = $wp_embed->autoembed( $embed ); 2076 2085 } … … 2084 2093 if ( ! empty( $medias ) ) { 2085 2094 $media = reset( $medias ); 2086 2095 $url = wp_get_attachment_url( $media->ID ); 2087 $shortcode = sprintf( '[%s src="%s"]', $type, $url ); 2088 $post->format_content[ $cache_key ] = do_shortcode( $shortcode ); 2096 2097 $format_content = ''; 2098 $attr = array( 'src' => $url ); 2099 2100 if ( 'audio' == $type ) 2101 $format_content = wp_audio_shortcode( $attr ); 2102 elseif ( 'video' == $type ) 2103 $format_content = wp_video_shortcode( $attr ); 2104 2105 $post->format_content[ $cache_key ] = $format_content; 2089 2106 return $post->format_content[ $cache_key ]; 2090 2107 } 2091 2108 … … 2164 2181 if ( 'caption' === $shortcode[2] ) { 2165 2182 $captions[] = $shortcode[0]; 2166 2183 if ( $html ) 2167 $tags[] = do_shortcode ( $shortcode[0]);2184 $tags[] = do_shortcode_tag( $shortcode ); 2168 2185 } 2169 2186 2170 2187 if ( $limit > 0 && count( $tags ) >= $limit ) … … 2410 2427 foreach ( $urls as $url ) { 2411 2428 if ( strstr( $shortcode[0], $url ) ) { 2412 2429 if ( ! $matched ) 2413 $matched = do_shortcode ( $shortcode[0]);2430 $matched = do_shortcode_tag( $shortcode ); 2414 2431 // $content = str_replace( $shortcode[0], '', $content, $count ); 2415 2432 } 2416 2433 }