Changeset 24547
- Timestamp:
- 07/03/2013 08:19:00 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
wp-admin/includes/media.php (modified) (2 diffs)
-
wp-includes/media.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/media.php
r24446 r24547 2358 2358 elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'audio/' ) ): 2359 2359 2360 echo do_shortcode( '[audio src="' . $att_url . '"]');2360 echo wp_audio_shortcode( array( 'src' => $att_url ) ); 2361 2361 2362 2362 elseif ( $attachment_id && 0 === strpos( $post->post_mime_type, 'video/' ) ): … … 2370 2370 $h = round( ( $meta['height'] * $w ) / $meta['width'] ); 2371 2371 2372 $shortcode = sprintf( '[video src="%s"%s%s]', 2373 $att_url, 2374 empty( $meta['width'] ) ? '' : sprintf( ' width="%d"', $w ), 2375 empty( $meta['height'] ) ? '' : sprintf( ' height="%d"', $h ) 2376 ); 2377 echo do_shortcode( $shortcode ); 2372 $attr = array( 'src' => $att_url ); 2373 2374 if ( ! empty( $meta['width' ] ) ) 2375 $attr['width'] = $w; 2376 2377 if ( ! empty( $meta['height'] ) ) 2378 $attr['height'] = $h; 2379 2380 echo wp_video_shortcode( $attr ); 2378 2381 2379 2382 endif; ?> -
trunk/wp-includes/media.php
r24400 r24547 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 ); … … 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 } … … 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 … … 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 }
Note: See TracChangeset
for help on using the changeset viewer.