diff --git a/packages/block-library/src/latest-posts/index.php b/packages/block-library/src/latest-posts/index.php index 823989cb30af4..18920eca86071 100644 --- a/packages/block-library/src/latest-posts/index.php +++ b/packages/block-library/src/latest-posts/index.php @@ -47,7 +47,11 @@ function render_block_core_latest_posts( $attributes ) { $list_items_markup .= "\n"; } - $class = "wp-block-latest-posts align{$attributes['align']}"; + $class = 'wp-block-latest-posts'; + if ( isset( $attributes['align'] ) ) { + $class .= ' align' . $attributes['align']; + } + if ( isset( $attributes['postLayout'] ) && 'grid' === $attributes['postLayout'] ) { $class .= ' is-grid'; } @@ -98,8 +102,7 @@ function register_block_core_latest_posts() { 'default' => 3, ), 'align' => array( - 'type' => 'string', - 'default' => 'center', + 'type' => 'string', ), 'order' => array( 'type' => 'string',