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:
parent
e96cf98d30
commit
3c7904727b
|
@ -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 );
|
||||
|
|
Loading…
Reference in New Issue