WordPress.org

Make WordPress Core


Ignore:
Timestamp:
02/13/2015 05:51:22 PM (6 years ago)
Author:
lancewillett
Message:

Bundled themes: replace array_shift() with current() for performance.

Props SergeyBiryukov, fixes #31260.

File:
1 edited

Legend:

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

    r31250 r31453  
    150150                                        $post_thumbnail = get_the_post_thumbnail();
    151151                                    elseif ( $total_images > 0 ) :
    152                                         $image          = array_shift( $images );
     152                                        $image          = current( $images );
    153153                                        $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' );
    154154                                    endif;
Note: See TracChangeset for help on using the changeset viewer.