@@ -318,6 +318,8 @@ function vantage_panels_row_style_fields( $fields ) {
318318
319319if ( ! function_exists ( 'vantage_panels_panels_row_style_attributes ' ) ) {
320320 function vantage_panels_panels_row_style_attributes ( $ attr , $ style ) {
321+ static $ pb_css_container_breaker ;
322+
321323 if ( empty ( $ attr ['style ' ] ) ) {
322324 $ attr ['style ' ] = '' ;
323325 }
@@ -342,15 +344,31 @@ function vantage_panels_panels_row_style_attributes( $attr, $style ) {
342344 $ attr ['style ' ] .= 'background-repeat: repeat; ' ;
343345 }
344346
345- if ( isset ( $ style ['row_stretch ' ] ) && strpos ( $ style ['row_stretch ' ], 'full ' ) !== false ) {
346- // We'll use this to prevent the jump when loading.
347- $ attr ['class ' ][] = 'panel-row-style-full-width ' ;
348- }
349-
350347 if ( empty ( $ attr ['style ' ] ) ) {
351348 unset( $ attr ['style ' ] );
352349 }
353350
351+ if (
352+ isset ( $ style ['row_stretch ' ] ) &&
353+ strpos ( $ style ['row_stretch ' ], 'full ' ) !== false
354+ ) {
355+
356+ if ( empty ( $ pb_css_container_breaker ) ) {
357+ $ pb_css_container_breaker = method_exists ( 'SiteOrigin_Panels ' , 'container_settings ' ) ? SiteOrigin_Panels::container_settings () : null ;
358+ }
359+
360+ // If the CSS Container Breaker is enabled, it'll prevent the jump for us.
361+ if (
362+ is_array ( $ pb_css_container_breaker ) &&
363+ $ pb_css_container_breaker ['css_override ' ]
364+ ) {
365+ return $ attr ;
366+ }
367+
368+ // We'll use this to prevent the jump when loading.
369+ $ attr ['class ' ][] = 'panel-row-style-full-width ' ;
370+ }
371+
354372 return $ attr ;
355373 }
356374}
0 commit comments