Make WordPress Core


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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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.