Changeset 24391 for trunk/wp-content/themes/twentythirteen/functions.php
- Timestamp:
- 05/31/2013 05:45:00 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-content/themes/twentythirteen/functions.php
r24390 r24391 95 95 add_theme_support( 'post-thumbnails' ); 96 96 set_post_thumbnail_size( 604, 270, true ); 97 98 // Register custom image size for image post formats.99 add_image_size( 'twentythirteen-image-post', 724, 1288 );100 97 101 98 // This theme uses its own gallery styles. … … 437 434 */ 438 435 function twentythirteen_get_link_url() { 439 $has_url = get_the_post_format_url(); 436 $content = get_the_content(); 437 $has_url = get_content_url( $content ); 440 438 441 439 return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() ); … … 493 491 */ 494 492 function twentythirteen_content_width() { 495 if ( has_post_format( 'video' ) || is_attachment() ) { 496 global $content_width; 493 global $content_width; 494 495 if ( is_attachment() ) 497 496 $content_width = 724; 498 } 497 elseif ( has_post_format( 'audio' ) ) 498 $content_width = 484; 499 499 } 500 500 add_action( 'template_redirect', 'twentythirteen_content_width' ); 501 502 /**503 * Adjusts content_width value for video shortcodes in video post formats.504 *505 * @since Twenty Thirteen 1.0506 *507 * @param array $atts The attribute list.508 * @return array The filtered attribute list.509 */510 function twentythirteen_video_width( $atts ) {511 if ( ! is_admin() && has_post_format( 'video' ) ) {512 $new_width = 724;513 $atts['height'] = round( ( $atts['height'] * $new_width ) / $atts['width'] );514 $atts['width'] = $new_width;515 }516 517 return $atts;518 }519 add_action( 'embed_defaults', 'twentythirteen_video_width' );520 add_action( 'shortcode_atts_video', 'twentythirteen_video_width' );521 501 522 502 /**
Note: See TracChangeset
for help on using the changeset viewer.