Avoid a PHP notice in bundled themes if no images were found.

props nabil_kadimi.
fixes #28361.
Built from https://develop.svn.wordpress.org/trunk@28585


git-svn-id: http://core.svn.wordpress.org/trunk@28410 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2014-05-27 10:55:30 +00:00
parent e96cf98d30
commit 3c7904727b
1 changed files with 1 additions and 1 deletions

View File

@ -58,9 +58,9 @@ foreach ( $attachments as $k => $attachment ) :
break;
endforeach;
$k++;
// If there is more than 1 attachment in a gallery
if ( count( $attachments ) > 1 ) :
$k++;
if ( isset( $attachments[ $k ] ) ) :
// get the URL of the next image attachment
$next_attachment_url = get_attachment_link( $attachments[ $k ]->ID );