WordPress.org

Make WordPress Core

Changeset 31842


Ignore:
Timestamp:
03/20/2015 02:03:45 AM (6 years ago)
Author:
SergeyBiryukov
Message:

Bundled themes: After [31453], replace current() with reset(), which is guaranteed to be the first item.

see #31259, #31260.

Location:
trunk/src/wp-content/themes
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-content/themes/twentyeleven/content-gallery.php

    r31453 r31842  
    3737                if ( $images ) :
    3838                    $total_images = count( $images );
    39                     $image = current( $images );
     39                    $image = reset( $images );
    4040            ?>
    4141                <figure class="gallery-thumb">
  • trunk/src/wp-content/themes/twentyfourteen/functions.php

    r31784 r31842  
    331331        // or get the URL of the first image attachment.
    332332        else {
    333             $next_attachment_url = get_attachment_link( current( $attachment_ids ) );
     333            $next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
    334334        }
    335335    }
  • trunk/src/wp-content/themes/twentyfourteen/inc/widgets.php

    r31453 r31842  
    150150                                        $post_thumbnail = get_the_post_thumbnail();
    151151                                    elseif ( $total_images > 0 ) :
    152                                         $image          = current( $images );
     152                                        $image          = reset( $images );
    153153                                        $post_thumbnail = wp_get_attachment_image( $image, 'post-thumbnail' );
    154154                                    endif;
  • trunk/src/wp-content/themes/twentyten/loop.php

    r31453 r31842  
    7676                    if ( $images ) :
    7777                        $total_images = count( $images );
    78                         $image = current( $images );
     78                        $image = reset( $images );
    7979                ?>
    8080                        <div class="gallery-thumb">
  • trunk/src/wp-content/themes/twentythirteen/functions.php

    r31785 r31842  
    432432        // or get the URL of the first image attachment.
    433433        else
    434             $next_attachment_url = get_attachment_link( current( $attachment_ids ) );
     434            $next_attachment_url = get_attachment_link( reset( $attachment_ids ) );
    435435    }
    436436
Note: See TracChangeset for help on using the changeset viewer.