Make WordPress Core


Ignore:
Timestamp:
05/31/2013 05:45:00 PM (11 years ago)
Author:
lancewillett
Message:

Twenty Thirteen: remove all post_format_*() and the_remaining_content() function calls, reverting to the_content(). Simplify functions.php, JS, and CSS files accordingly. Props obenland for starter patch, fixes #24469 and #24407. See #24452.

File:
1 edited

Legend:

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

    r24390 r24391  
    9595    add_theme_support( 'post-thumbnails' );
    9696    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 );
    10097
    10198    // This theme uses its own gallery styles.
     
    437434 */
    438435function twentythirteen_get_link_url() {
    439     $has_url = get_the_post_format_url();
     436    $content = get_the_content();
     437    $has_url = get_content_url( $content );
    440438
    441439    return ( $has_url ) ? $has_url : apply_filters( 'the_permalink', get_permalink() );
     
    493491 */
    494492function twentythirteen_content_width() {
    495     if ( has_post_format( 'video' ) || is_attachment() ) {
    496         global $content_width;
     493    global $content_width;
     494
     495    if ( is_attachment() )
    497496        $content_width = 724;
    498     }
     497    elseif ( has_post_format( 'audio' ) )
     498        $content_width = 484;
    499499}
    500500add_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.0
    506  *
    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' );
    521501
    522502/**
Note: See TracChangeset for help on using the changeset viewer.