diff --git a/lib/block-supports/layout.php b/lib/block-supports/layout.php index e522390184a6d6..4959fab09a0dc7 100644 --- a/lib/block-supports/layout.php +++ b/lib/block-supports/layout.php @@ -167,12 +167,11 @@ function gutenberg_render_layout_support_flag( $block_content, $block ) { $id = uniqid(); $style = gutenberg_get_layout_style( ".wp-container-$id", $used_layout, $has_block_gap_support ); $container_class = 'wp-container-' . $id . ' '; - $justify_class = $used_layout['justifyContent'] ? 'wp-justify-' . $used_layout['justifyContent'] . ' ' : ''; // This assumes the hook only applies to blocks with a single wrapper. // I think this is a reasonable limitation for that particular hook. $content = preg_replace( '/' . preg_quote( 'class="', '/' ) . '/', - 'class="' . $container_class . $justify_class, + 'class="' . $container_class, $block_content, 1 ); diff --git a/packages/block-library/src/query-pagination/index.php b/packages/block-library/src/query-pagination/index.php index ae32242bc9e49a..df150ae828ceaa 100644 --- a/packages/block-library/src/query-pagination/index.php +++ b/packages/block-library/src/query-pagination/index.php @@ -18,9 +18,12 @@ function render_block_core_query_pagination( $attributes, $content ) { return ''; } + $justify_content = $attributes['layout']['justifyContent']; + $justify_class = isset( $justify_content ) ? 'wp-justify-' . $justify_content : ''; + return sprintf( '
%2$s
', - get_block_wrapper_attributes(), + get_block_wrapper_attributes( array( 'class' => $justify_class ) ), $content ); }