From 6907174995627efbf3a4786f410bb9e5f9df8870 Mon Sep 17 00:00:00 2001 From: Lance Willett Date: Thu, 11 Apr 2013 23:06:15 +0000 Subject: [PATCH] Twenty Thirteen: adjust `content_width` value for video shortcodes in video post formats and on attachment templates. See #23955, props obenland. git-svn-id: http://core.svn.wordpress.org/trunk@23972 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- .../themes/twentythirteen/functions.php | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/wp-content/themes/twentythirteen/functions.php b/wp-content/themes/twentythirteen/functions.php index 0feec859e4..b9e588af47 100644 --- a/wp-content/themes/twentythirteen/functions.php +++ b/wp-content/themes/twentythirteen/functions.php @@ -524,10 +524,11 @@ function twentythirteen_comment_class( $classes ) { add_filter( 'comment_class', 'twentythirteen_comment_class' ); /** - * Adjusts content_width value for image post formats, video post formats, and - * image attachment templates. + * Adjusts content_width value for video post formats and attachment templates. * * @since Twenty Thirteen 1.0 + * + * @return void */ function twentythirteen_content_width() { if ( has_post_format( 'video' ) || is_attachment() ) { @@ -537,6 +538,23 @@ function twentythirteen_content_width() { } add_action( 'template_redirect', 'twentythirteen_content_width' ); +/** + * Adjusts content_width value for video shortcodes in video post formats. + * + * @since Twenty Thirteen 1.0 + * + * @param array $atts Attribute list. + * @return array Filtered attribute list. + */ +function twentythirteen_video_width( $atts ) { + if ( has_post_format( 'video' ) ) + $atts['width'] = 724; + + return $atts; +} +add_action( 'embed_defaults', 'twentythirteen_video_width' ); +add_action( 'shortcode_atts_video', 'twentythirteen_video_width' ); + /** * Adds entry date to aside posts after the content. *