File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -606,15 +606,18 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
606606 'declarations ' => $ child_layout_declarations ,
607607 );
608608
609+ $ minimum_column_width = isset ( $ block ['attrs ' ]['style ' ]['layout ' ]['minimumColumnWidth ' ] ) ? $ block ['attrs ' ]['style ' ]['layout ' ]['minimumColumnWidth ' ] : null ;
610+ $ column_count = isset ( $ block ['attrs ' ]['style ' ]['layout ' ]['columnCount ' ] ) ? $ block ['attrs ' ]['style ' ]['layout ' ]['columnCount ' ] : null ;
611+
609612 /*
610613 * If columnSpan is set, and the parent grid is responsive, i.e. if it has a minimumColumnWidth set,
611614 * the columnSpan should be removed on small grids. If there's a minimumColumnWidth, the grid is responsive.
612615 * But if the minimumColumnWidth value wasn't changed, it won't be set. In that case, if columnCount doesn't
613616 * exist, we can assume that the grid is responsive.
614617 */
615- if ( isset ( $ block [ ' attrs ' ][ ' style ' ][ ' layout ' ][ ' columnSpan ' ] ) && ( isset ( $ block [ ' parentLayout ' ][ ' minimumColumnWidth ' ] ) || ! isset ( $ block [ ' parentLayout ' ][ ' columnCount ' ] ) ) ) {
616- $ column_span_number = floatval ( $ block [ ' attrs ' ][ ' style ' ][ ' layout ' ][ ' columnSpan ' ] );
617- $ parent_column_width = isset ( $ block [ ' parentLayout ' ][ ' minimumColumnWidth ' ] ) ? $ block [ ' parentLayout ' ][ ' minimumColumnWidth ' ] : '12rem ' ;
618+ if ( $ column_span && ( $ minimum_column_width || ! $ column_count ) ) {
619+ $ column_span_number = floatval ( $ column_span );
620+ $ parent_column_width = $ minimum_column_width ? $ minimum_column_width : '12rem ' ;
618621 $ parent_column_value = floatval ( $ parent_column_width );
619622 $ parent_column_unit = explode ( $ parent_column_value , $ parent_column_width );
620623
You can’t perform that action at this time.
0 commit comments