From 3a92986674b8c9383f9d9fbd7c621e45f93889b7 Mon Sep 17 00:00:00 2001 From: nfmohit Date: Fri, 10 Aug 2018 22:10:35 +0600 Subject: [PATCH 1/2] Make sure Latest Posts block doesn't apply alignment classes if no alignment is selected --- packages/block-library/src/latest-posts/index.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/block-library/src/latest-posts/index.php b/packages/block-library/src/latest-posts/index.php index 823989cb30af43..84a0c1c9cedaad 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'; } @@ -99,7 +103,6 @@ function register_block_core_latest_posts() { ), 'align' => array( 'type' => 'string', - 'default' => 'center', ), 'order' => array( 'type' => 'string', From c1fabd2388697ef3f89a6ed724ca90296676b3ae Mon Sep 17 00:00:00 2001 From: Andrew Duthie Date: Mon, 13 Aug 2018 11:45:37 -0400 Subject: [PATCH 2/2] Blocks: Fix Latest Posts align assignment alignment --- packages/block-library/src/latest-posts/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/block-library/src/latest-posts/index.php b/packages/block-library/src/latest-posts/index.php index 84a0c1c9cedaad..18920eca860719 100644 --- a/packages/block-library/src/latest-posts/index.php +++ b/packages/block-library/src/latest-posts/index.php @@ -102,7 +102,7 @@ function register_block_core_latest_posts() { 'default' => 3, ), 'align' => array( - 'type' => 'string', + 'type' => 'string', ), 'order' => array( 'type' => 'string',