Skip to content

Commit 44e359a

Browse files
committed
Use new functions in layout block supports
1 parent a81dfd2 commit 44e359a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

lib/block-supports/layout.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,9 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) {
116116
return $block_content;
117117
}
118118

119-
$tree = WP_Theme_JSON_Resolver_Gutenberg::get_merged_data( array(), 'theme' );
120-
$theme_settings = $tree->get_settings();
121-
$default_layout = _wp_array_get( $theme_settings, array( 'layout' ) );
122-
$has_block_gap_support = isset( $theme_settings['spacing']['blockGap'] ) ? null !== $theme_settings['spacing']['blockGap'] : false;
119+
$block_gap = gutenberg_get_global_settings( array( 'spacing', 'blockGap' ) );
120+
$default_layout = gutenberg_get_global_settings( array( 'layout' ) );
121+
$has_block_gap_support = isset( $block_gap ) ? null !== $block_gap : false;
123122
$default_block_layout = _wp_array_get( $block_type->supports, array( '__experimentalLayout', 'default' ), array() );
124123
$used_layout = isset( $block['attrs']['layout'] ) ? $block['attrs']['layout'] : $default_block_layout;
125124
if ( isset( $used_layout['inherit'] ) && $used_layout['inherit'] ) {

0 commit comments

Comments
 (0)