Changeset 23989
- Timestamp:
- 04/14/2013 04:43:26 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/js/post-formats.js
r23969 r23989 112 112 113 113 mediaPreview = function (attachment) { 114 var dimensions = '', url = attachment.url,114 var w, h, dimensions = '', url = attachment.url, 115 115 mime = attachment.mime, 116 116 format = attachment.type; 117 117 118 118 if ( 'video' === format ) { 119 if ( attachment.width ) 120 dimensions += ' width="' + attachment.width + '"'; 121 if ( attachment.height ) 122 dimensions += ' height="' + attachment.height + '"'; 119 if ( attachment.width ) { 120 w = attachment.width; 121 if ( w > 600 ) 122 w = 600; 123 dimensions += ' width="' + w + '"'; 124 } 125 126 if ( attachment.height ) { 127 h = attachment.height; 128 if ( attachment.width && w < attachment.width ) 129 h = Math.round( ( h * w ) / attachment.width ); 130 dimensions += ' height="' + h + '"'; 131 } 123 132 } 124 133 -
trunk/wp-content/themes/twentythirteen/functions.php
r23972 r23989 548 548 */ 549 549 function twentythirteen_video_width( $atts ) { 550 if ( has_post_format( 'video' ) ) 551 $atts['width'] = 724; 550 if ( ! is_admin() && has_post_format( 'video' ) ) { 551 $new_width = 724; 552 $atts['height'] = round( ( $atts['height'] * $new_width ) / $atts['width'] ); 553 $atts['width'] = $new_width; 554 } 552 555 553 556 return $atts; -
trunk/wp-includes/media.php
r23988 r23989 957 957 'width' => empty( $content_width ) ? 640 : $content_width, 958 958 ); 959 959 960 foreach ( $default_types as $type ) 960 961 $defaults_atts[$type] = ''; … … 962 963 $atts = shortcode_atts( $defaults_atts, $attr, 'video' ); 963 964 extract( $atts ); 965 966 $w = $width; 967 $h = $height; 968 if ( is_admin() && $width > 600 ) 969 $w = 600; 970 elseif ( ! is_admin() && $w > $defaults_atts['width'] ) 971 $w = $defaults_atts['width']; 972 973 if ( $w < $width ) 974 $height = round( ( $h * $w ) / $width ); 975 976 $width = $w; 964 977 965 978 $primary = false;
Note: See TracChangeset
for help on using the changeset viewer.