Skip to content

Commit

Permalink
Carousel: check array to avoid PHP warnings (#28388)
Browse files Browse the repository at this point in the history
  • Loading branch information
bindlegirl authored Jan 18, 2023
1 parent 9439f40 commit d54d3f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/fix-carousel-array-check
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Carousel: verify array to avoid PHP warnings
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,10 @@ class_exists( 'Jetpack_AMP_Support' )
}
$image_elements = $selected_images[ $attachment->ID ];

if ( ! is_array( $image_elements ) ) {
continue;
}

$attributes = $this->add_data_to_images( array(), $attachment );
$attributes_html = '';
foreach ( $attributes as $k => $v ) {
Expand Down

0 comments on commit d54d3f6

Please sign in to comment.