Skip to content

Commit

Permalink
Merge pull request #2004 from siteorigin/carousel-resolve-abs-deprecated
Browse files Browse the repository at this point in the history
Carousel: Resolve `Deprecated`
  • Loading branch information
AlexGStapleton authored Jun 26, 2024
2 parents 767b42c + c1c8ab3 commit 4045094
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion base/inc/widgets/base-carousel.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,9 @@ public function responsive_template_variables( $responsive, $encode = true ) {
}

// Negative values can be problematic so let's avoid them by ensuring everything is positive.
$variables = array_map( 'abs', $variables );
$variables = array_map( function( $value ) {
return is_null( $value ) ? 0 : abs( $value );
}, $variables );

return $encode ? json_encode( $variables ) : $variables;
}
Expand Down

0 comments on commit 4045094

Please sign in to comment.