Make WordPress Core

Changeset 26225


Ignore:
Timestamp:
11/15/2013 09:14:49 PM (10 years ago)
Author:
lancewillett
Message:

Twenty Fourteen: limit back compat to 3.6 and later versions. See #26055, props obenland.

Location:
trunk/src/wp-content/themes/twentyfourteen
Files:
1 added
2 edited

Legend:

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

    r26218 r26225  
    3434if ( ! isset( $content_width ) )
    3535    $content_width = 474;
     36
     37/**
     38 * Twenty Fourteen only works in WordPress 3.6 or later.
     39 */
     40if ( version_compare( $GLOBALS['wp_version'], '3.6', '<' ) )
     41    require get_template_directory() . '/inc/back-compat.php';
    3642
    3743if ( ! function_exists( 'twentyfourteen_setup' ) ) :
     
    218224 */
    219225function twentyfourteen_scripts() {
    220     global $wp_styles;
    221 
    222226    // Add Lato font, used in the main stylesheet.
    223227    wp_enqueue_style( 'twentyfourteen-lato', twentyfourteen_font_url(), array(), null );
     
    231235    // Load the Internet Explorer specific stylesheet.
    232236    wp_enqueue_style( 'twentyfourteen-ie', get_template_directory_uri() . '/css/ie.css', array( 'twentyfourteen-style' ), '20131110' );
    233     $wp_styles->add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' );
     237    wp_style_add_data( 'twentyfourteen-ie', 'conditional', 'lt IE 9' );
    234238
    235239    if ( is_singular() && comments_open() && get_option( 'thread_comments' ) )
  • trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php

    r26154 r26225  
    132132                                    $images = array();
    133133
    134                                     if ( function_exists( 'get_post_galleries' ) ) {
    135                                         $galleries = get_post_galleries( get_the_ID(), false );
    136                                         if ( isset( $galleries[0]['ids'] ) )
    137                                             $images = explode( ',', $galleries[0]['ids'] );
    138                                     } else {
    139                                         $pattern = get_shortcode_regex();
    140                                         preg_match( "/$pattern/s", get_the_content(), $match );
    141                                         $atts = shortcode_parse_atts( $match[3] );
    142                                         if ( isset( $atts['ids'] ) )
    143                                             $images = explode( ',', $atts['ids'] );
    144                                     }
     134                                    $galleries = get_post_galleries( get_the_ID(), false );
     135                                    if ( isset( $galleries[0]['ids'] ) )
     136                                        $images = explode( ',', $galleries[0]['ids'] );
    145137
    146138                                    if ( ! $images ) :
    147139                                        $images = get_posts( array(
    148140                                            'fields'         => 'ids',
    149                                             'numberposts'    => 999,
     141                                            'numberposts'    => -1,
    150142                                            'order'          => 'ASC',
    151143                                            'orderby'        => 'menu_order',
     
    167159                                    if ( ! empty ( $post_thumbnail ) ) :
    168160                        ?>
    169                                     <a href="<?php the_permalink(); ?>"><?php echo $post_thumbnail; ?></a>
    170                                 <?php
    171                                     endif;
    172                                 ?>
    173                                     <p class="wp-caption-text">
    174                                     <?php
    175                                         printf( _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ),
    176                                             esc_url( get_permalink() ),
    177                                             number_format_i18n( $total_images )
    178                                         );
    179                                     ?>
    180                                     </p>
     161                        <a href="<?php the_permalink(); ?>"><?php echo $post_thumbnail; ?></a>
     162                        <?php endif; ?>
     163                        <p class="wp-caption-text">
    181164                            <?php
     165                                printf( _n( 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photo</a>.', 'This gallery contains <a href="%1$s" rel="bookmark">%2$s photos</a>.', $total_images, 'twentyfourteen' ),
     166                                    esc_url( get_permalink() ),
     167                                    number_format_i18n( $total_images )
     168                                );
     169                            ?>
     170                        </p>
     171                        <?php
    182172                                endif;
    183173
Note: See TracChangeset for help on using the changeset viewer.