Make WordPress Core

Changeset 38026


Ignore:
Timestamp:
07/09/2016 03:10:38 PM (8 years ago)
Author:
karmatosed
Message:

PHP 7 compatibility issues fixed in Twenty Thirteen and Twenty Fourteen
Props xknown
Fixes #37227
--This Line, and those below, will be ignored--

M themes/twentyfourteen/functions.php
M themes/twentythirteen/functions.php

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

Legend:

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

    r37040 r38026  
    320320    // If there is more than 1 attachment in a gallery...
    321321    if ( count( $attachment_ids ) > 1 ) {
    322         foreach ( $attachment_ids as $attachment_id ) {
     322        foreach ( $attachment_ids as $idx => $attachment_id ) {
    323323            if ( $attachment_id == $post->ID ) {
    324                 $next_id = current( $attachment_ids );
     324                $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ];
    325325                break;
    326326            }
  • trunk/src/wp-content/themes/twentythirteen/functions.php

    r37040 r38026  
    422422    // If there is more than 1 attachment in a gallery...
    423423    if ( count( $attachment_ids ) > 1 ) {
    424         foreach ( $attachment_ids as $attachment_id ) {
     424        foreach ( $attachment_ids as $idx => $attachment_id ) {
    425425            if ( $attachment_id == $post->ID ) {
    426                 $next_id = current( $attachment_ids );
     426                $next_id = $attachment_ids[ ( $idx + 1 ) % count( $attachment_ids ) ];
    427427                break;
    428428            }
Note: See TracChangeset for help on using the changeset viewer.