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 2b6c8462b3
commit fd16ae485b
3 changed files with 5 additions and 3 deletions

View File

@ -57,9 +57,10 @@ get_header(); ?>
if ( $attachment->ID == $post->ID )
break;
}
$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 );

View File

@ -71,9 +71,10 @@
if ( $attachment->ID == $post->ID )
break;
}
$k++;
// If there is more than 1 image 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 );

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 );