Skip to content

Commit

Permalink
Merge pull request #1220 from siteorigin/vantage-compat-resolve-TypeE…
Browse files Browse the repository at this point in the history
…rror

Vantage Compat: Resolve Potential TypeError
  • Loading branch information
AlexGStapleton authored Jun 30, 2024
2 parents 9bfe11e + 76226b8 commit 3839145
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion compat/vantage.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<?php
function siteorigin_panels_vantage_row_style_attributes( $attributes, $style ) {
if ( empty( $style['class'] ) ) {
return $attributes;
}

if ( isset( $style['class'] ) && $style['class'] == 'wide-grey' && ! empty( $attributes['style'] ) ) {
$attributes['style'] = preg_replace( '/padding-left: 1000px; padding-right: 1000px;/', '', $attributes['style'] );
}
Expand All @@ -11,7 +15,10 @@ function siteorigin_panels_vantage_row_style_attributes( $attributes, $style ) {
// Ensure all full width stretched rows have padding.
// This will prevent a situation where the content is squished.
function siteorigin_panels_vantage_full_width_stretch( $data, $post_id ) {
if ( empty( $data['grids'] ) ) {
if (
! is_array( $data ) ||
empty( $data['grids'] )
) {
return $data;
}

Expand Down

0 comments on commit 3839145

Please sign in to comment.