- Timestamp:
- 11/15/2013 09:14:49 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php
r26154 r26225 132 132 $images = array(); 133 133 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'] ); 145 137 146 138 if ( ! $images ) : 147 139 $images = get_posts( array( 148 140 'fields' => 'ids', 149 'numberposts' => 999,141 'numberposts' => -1, 150 142 'order' => 'ASC', 151 143 'orderby' => 'menu_order', … … 167 159 if ( ! empty ( $post_thumbnail ) ) : 168 160 ?> 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"> 181 164 <?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 182 172 endif; 183 173
Note: See TracChangeset
for help on using the changeset viewer.