WordPress.org

Make WordPress Core

Ticket #23955: 23955.video-width.2.diff

File 23955.video-width.2.diff, 1.3 KB (added by obenland, 12 months ago)
  • wp-content/themes/twentythirteen/functions.php

     
    524524add_filter( 'comment_class', 'twentythirteen_comment_class' ); 
    525525 
    526526/** 
    527  * Adjusts content_width value for image post formats, video post formats, and 
    528  * image attachment templates. 
     527 * Adjusts content_width value for video post formats and attachment templates. 
    529528 * 
    530529 * @since Twenty Thirteen 1.0 
     530 * 
     531 * @return void 
    531532 */ 
    532533function twentythirteen_content_width() { 
    533534        if ( has_post_format( 'video' ) || is_attachment() ) { 
     
    538539add_action( 'template_redirect', 'twentythirteen_content_width' ); 
    539540 
    540541/** 
     542 * Adjusts content_width value for video shortcodes in video post formats and 
     543 * on attachment templates. 
     544 * 
     545 * @since Twenty Thirteen 1.0 
     546 * 
     547 * @param array $atts Attribute list. 
     548 * @return array Filtered attribute list. 
     549 */ 
     550function twentythirteen_video_width( $atts ) { 
     551        if ( has_post_format( 'video' ) ) { 
     552                $atts['width'] = 724; 
     553        } 
     554        return $atts; 
     555} 
     556add_action( 'embed_defaults',       'twentythirteen_video_width' ); 
     557add_action( 'shortcode_atts_video', 'twentythirteen_video_width' ); 
     558 
     559/** 
    541560 * Adds entry date to aside posts after the content. 
    542561 * 
    543562 *