Make WordPress Core


Ignore:
Timestamp:
04/14/2013 04:43:26 PM (14 years ago)
Author:
markjaquith
Message:

Constrain large videos from rendering bigger than $content_width on both frontend and backend.

props wonderboymusic. fixes #23955.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-content/themes/twentythirteen/functions.php

    r23972 r23989  
    548548 */
    549549function 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        }
    552555
    553556        return $atts;
Note: See TracChangeset for help on using the changeset viewer.