From 92b61a7c44520b5c061990f0fc8503981090b6c6 Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Wed, 6 May 2026 10:49:33 +1000 Subject: [PATCH 1/5] Add layout and block spacing support to Latest Posts block --- docs/reference-guides/core-blocks.md | 2 +- .../block-library/src/latest-posts/block.json | 9 ++- .../src/latest-posts/constants.js | 1 - .../src/latest-posts/deprecated.js | 64 ++++++++++++++-- .../block-library/src/latest-posts/edit.js | 76 ++++++++----------- .../block-library/src/latest-posts/index.php | 17 ++++- .../block-library/src/latest-posts/style.scss | 14 +++- .../src/latest-posts/test/deprecated.js | 38 ++++++++++ phpunit/blocks/render-last-posts-test.php | 46 +++++++++++ 9 files changed, 208 insertions(+), 59 deletions(-) create mode 100644 packages/block-library/src/latest-posts/test/deprecated.js diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index f99e4785ac736a..1135639445890c 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -462,7 +462,7 @@ Display a list of your most recent posts. ([Source](https://github.com/WordPress - **Name:** core/latest-posts - **Category:** widgets -- **Supports:** align, anchor, color (background, gradients, link, text), interactivity (clientNavigation), spacing (margin, padding), typography (fontSize, lineHeight), ~~html~~ +- **Supports:** align, anchor, color (background, gradients, link, text), interactivity (clientNavigation), layout, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ - **Attributes:** addLinkToFeaturedImage, categories, columns, displayAuthor, displayFeaturedImage, displayPostContent, displayPostContentRadio, displayPostDate, excerptLength, featuredImageAlign, featuredImageSizeHeight, featuredImageSizeSlug, featuredImageSizeWidth, order, orderBy, postLayout, postsToShow, selectedAuthor ## List diff --git a/packages/block-library/src/latest-posts/block.json b/packages/block-library/src/latest-posts/block.json index 03de79be44ce71..fe86608f02413f 100644 --- a/packages/block-library/src/latest-posts/block.json +++ b/packages/block-library/src/latest-posts/block.json @@ -86,6 +86,7 @@ "anchor": true, "align": true, "html": false, + "layout": true, "color": { "gradients": true, "link": true, @@ -97,7 +98,13 @@ }, "spacing": { "margin": true, - "padding": true + "padding": true, + "blockGap": { + "__experimentalDefault": "1.25em" + }, + "__experimentalDefaultControls": { + "blockGap": true + } }, "typography": { "fontSize": true, diff --git a/packages/block-library/src/latest-posts/constants.js b/packages/block-library/src/latest-posts/constants.js index bcb367ce9d7448..dded7c88e74801 100644 --- a/packages/block-library/src/latest-posts/constants.js +++ b/packages/block-library/src/latest-posts/constants.js @@ -1,4 +1,3 @@ export const MIN_EXCERPT_LENGTH = 10; export const MAX_EXCERPT_LENGTH = 100; -export const MAX_POSTS_COLUMNS = 6; export const DEFAULT_EXCERPT_LENGTH = 55; diff --git a/packages/block-library/src/latest-posts/deprecated.js b/packages/block-library/src/latest-posts/deprecated.js index d49b8abab56c08..e7f9e6ff631acb 100644 --- a/packages/block-library/src/latest-posts/deprecated.js +++ b/packages/block-library/src/latest-posts/deprecated.js @@ -3,27 +3,75 @@ */ import metadata from './block.json'; -const { attributes } = metadata; +const attributes = { + ...metadata.attributes, + layout: { + type: 'object', + }, +}; + +const migrateCategories = ( oldAttributes ) => { + if ( + ! oldAttributes.categories || + 'string' !== typeof oldAttributes.categories + ) { + return oldAttributes; + } + + // This needs the full category object, not just the ID. + return { + ...oldAttributes, + categories: [ { id: Number( oldAttributes.categories ) } ], + }; +}; + +const migratePostLayout = ( oldAttributes ) => { + const { postLayout, columns, layout, ...attributesWithoutLegacyLayout } = + oldAttributes; + + if ( layout || ! postLayout ) { + return oldAttributes; + } + + return { + ...attributesWithoutLegacyLayout, + layout: { + type: postLayout === 'grid' ? 'grid' : 'default', + ...( postLayout === 'grid' && columns && { columnCount: columns } ), + }, + }; +}; export default [ { attributes: { ...attributes, categories: { - type: 'string', + type: [ 'array', 'string' ], }, }, supports: { align: true, html: false, + layout: true, + }, + migrate: ( oldAttributes ) => + migratePostLayout( migrateCategories( oldAttributes ) ), + isEligible: ( { layout, postLayout } ) => ! layout && postLayout, + save: () => null, + }, + { + attributes: { + ...attributes, + categories: { + type: 'string', + }, }, - migrate: ( oldAttributes ) => { - // This needs the full category object, not just the ID. - return { - ...oldAttributes, - categories: [ { id: Number( oldAttributes.categories ) } ], - }; + supports: { + align: true, + html: false, }, + migrate: migrateCategories, isEligible: ( { categories } ) => categories && 'string' === typeof categories, save: () => null, diff --git a/packages/block-library/src/latest-posts/edit.js b/packages/block-library/src/latest-posts/edit.js index 81b754b85e135e..8396590cf4852d 100644 --- a/packages/block-library/src/latest-posts/edit.js +++ b/packages/block-library/src/latest-posts/edit.js @@ -49,7 +49,6 @@ import { createInterpolateElement } from '@wordpress/element'; import { MIN_EXCERPT_LENGTH, MAX_EXCERPT_LENGTH, - MAX_POSTS_COLUMNS, DEFAULT_EXCERPT_LENGTH, } from './constants'; import { useToolsPanelDropdownMenuProps } from '../utils/hooks'; @@ -105,7 +104,7 @@ function getCurrentAuthor( post ) { return post._embedded?.author?.[ 0 ]; } -function Controls( { attributes, setAttributes, postCount } ) { +function Controls( { attributes, setAttributes } ) { const { postsToShow, order, @@ -117,8 +116,6 @@ function Controls( { attributes, setAttributes, postCount } ) { displayPostContent, displayPostDate, displayAuthor, - postLayout, - columns, excerptLength, featuredImageAlign, featuredImageSizeSlug, @@ -473,7 +470,6 @@ function Controls( { attributes, setAttributes, postCount } ) { postsToShow: 5, categories: undefined, selectedAuthor: undefined, - columns: 3, } ) } dropdownMenuProps={ dropdownMenuProps } @@ -523,41 +519,16 @@ function Controls( { attributes, setAttributes, postCount } ) { selectedAuthorId={ selectedAuthor } /> - - { postLayout === 'grid' && ( - columns !== 3 } - label={ __( 'Columns' ) } - onDeselect={ () => - setAttributes( { - columns: 3, - } ) - } - isShownByDefault - > - - setAttributes( { columns: value } ) - } - min={ 2 } - max={ - ! postCount - ? MAX_POSTS_COLUMNS - : Math.min( MAX_POSTS_COLUMNS, postCount ) - } - required - /> - - ) } ); } -export default function LatestPostsEdit( { attributes, setAttributes } ) { +export default function LatestPostsEdit( { + attributes, + setAttributes, + __unstableLayoutClassNames, +} ) { const instanceId = useInstanceId( LatestPostsEdit ); const { @@ -571,6 +542,7 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { displayPostContent, displayPostDate, displayAuthor, + layout, postLayout, columns, excerptLength, @@ -580,6 +552,11 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { featuredImageSizeHeight, addLinkToFeaturedImage, } = attributes; + const { type: savedLayoutType, minimumColumnWidth } = layout || {}; + const layoutType = + savedLayoutType || ( postLayout === 'grid' ? 'grid' : 'default' ); + const columnCount = + layout?.columnCount ?? ( ! savedLayoutType ? columns : undefined ) ?? 3; const { latestPosts } = useSelect( ( select ) => { const { getEntityRecords } = select( coreStore ); @@ -626,18 +603,20 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { ); const blockProps = useBlockProps( { - className: clsx( { + className: clsx( __unstableLayoutClassNames, { 'wp-block-latest-posts__list': true, - 'is-grid': postLayout === 'grid', + 'is-grid': layoutType === 'grid', 'has-dates': displayPostDate, 'has-author': displayAuthor, - [ `columns-${ columns }` ]: postLayout === 'grid', + [ `columns-${ columnCount }` ]: + layoutType === 'grid' && columnCount, + 'has-native-responsive-grid': + layoutType === 'grid' && columnCount && minimumColumnWidth, } ), } ); @@ -662,18 +641,29 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) { ? latestPosts.slice( 0, postsToShow ) : latestPosts; + const setDisplayLayout = ( newDisplayLayout ) => + setAttributes( { + layout: { ...layout, ...newDisplayLayout }, + postLayout: undefined, + columns: undefined, + } ); + const layoutControls = [ { icon: list, title: _x( 'List view', 'Latest posts block display setting' ), - onClick: () => setAttributes( { postLayout: 'list' } ), - isActive: postLayout === 'list', + onClick: () => setDisplayLayout( { type: 'default' } ), + isActive: layoutType === 'default' || layoutType === 'constrained', }, { icon: grid, title: _x( 'Grid view', 'Latest posts block display setting' ), - onClick: () => setAttributes( { postLayout: 'grid' } ), - isActive: postLayout === 'grid', + onClick: () => + setDisplayLayout( { + type: 'grid', + columnCount, + } ), + isActive: layoutType === 'grid', }, ]; diff --git a/packages/block-library/src/latest-posts/index.php b/packages/block-library/src/latest-posts/index.php index c829852f8cfde7..7e86b6d5b25447 100644 --- a/packages/block-library/src/latest-posts/index.php +++ b/packages/block-library/src/latest-posts/index.php @@ -200,12 +200,23 @@ function render_block_core_latest_posts( $attributes ) { remove_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 ); + $layout = $attributes['layout'] ?? array(); + $legacy_layout_type = ( + isset( $attributes['postLayout'] ) && + 'grid' === $attributes['postLayout'] + ) ? 'grid' : 'default'; + $layout_type = $layout['type'] ?? $legacy_layout_type; + $column_count = $layout['columnCount'] ?? ( $attributes['columns'] ?? null ); + $classes = array( 'wp-block-latest-posts__list' ); - if ( isset( $attributes['postLayout'] ) && 'grid' === $attributes['postLayout'] ) { + if ( 'grid' === $layout_type ) { $classes[] = 'is-grid'; } - if ( isset( $attributes['columns'] ) && 'grid' === $attributes['postLayout'] ) { - $classes[] = 'columns-' . $attributes['columns']; + if ( 'grid' === $layout_type && ! empty( $column_count ) ) { + $classes[] = sanitize_title( 'columns-' . $column_count ); + } + if ( 'grid' === $layout_type && ! empty( $column_count ) && ! empty( $layout['minimumColumnWidth'] ) ) { + $classes[] = 'has-native-responsive-grid'; } if ( isset( $attributes['displayPostDate'] ) && $attributes['displayPostDate'] ) { $classes[] = 'has-dates'; diff --git a/packages/block-library/src/latest-posts/style.scss b/packages/block-library/src/latest-posts/style.scss index c056a2cf8c64ba..252b952cb804f3 100644 --- a/packages/block-library/src/latest-posts/style.scss +++ b/packages/block-library/src/latest-posts/style.scss @@ -1,3 +1,4 @@ +@use "@wordpress/base-styles/breakpoints" as *; @use "@wordpress/base-styles/mixins" as *; .wp-block-latest-posts { @@ -21,7 +22,9 @@ } } - &.is-grid { + // These rules no longer apply to blocks using layout support, but should + // be kept for backwards compatibility. + &.is-grid:not(.is-layout-grid) { display: flex; flex-wrap: wrap; @@ -33,7 +36,7 @@ @include break-small { @for $i from 2 through 6 { - &.columns-#{ $i } li { + &.columns-#{ $i }:not(.is-layout-grid) li { width: calc((100% / #{$i}) - 1.25em + (1.25em / #{$i})); &:nth-child(#{ $i }n) { @@ -44,6 +47,13 @@ } } +@media (max-width: $break-small) { + // Temporary specificity bump until "wp-container" layout specificity is revisited. + .wp-block-latest-posts-is-layout-grid[class*="columns-"]:not(.has-native-responsive-grid) { + grid-template-columns: 1fr; + } +} + :root { :where(.wp-block-latest-posts.is-grid) { padding: 0; diff --git a/packages/block-library/src/latest-posts/test/deprecated.js b/packages/block-library/src/latest-posts/test/deprecated.js new file mode 100644 index 00000000000000..e71ca95084ab56 --- /dev/null +++ b/packages/block-library/src/latest-posts/test/deprecated.js @@ -0,0 +1,38 @@ +/** + * Internal dependencies + */ +import deprecated from '../deprecated'; + +describe( 'Latest Posts deprecations', () => { + it( 'migrates legacy grid layout attributes to layout support attributes', () => { + const migratedAttributes = deprecated[ 0 ].migrate( { + postLayout: 'grid', + columns: 4, + postsToShow: 3, + } ); + + expect( migratedAttributes ).toEqual( { + layout: { + type: 'grid', + columnCount: 4, + }, + postsToShow: 3, + } ); + } ); + + it( 'preserves the legacy categories migration while migrating layout', () => { + const migratedAttributes = deprecated[ 0 ].migrate( { + categories: '7', + postLayout: 'grid', + columns: 2, + } ); + + expect( migratedAttributes ).toEqual( { + categories: [ { id: 7 } ], + layout: { + type: 'grid', + columnCount: 2, + }, + } ); + } ); +} ); diff --git a/phpunit/blocks/render-last-posts-test.php b/phpunit/blocks/render-last-posts-test.php index f26da1cfa6724b..a6813f2c438a0f 100644 --- a/phpunit/blocks/render-last-posts-test.php +++ b/phpunit/blocks/render-last-posts-test.php @@ -112,4 +112,50 @@ public function test_render_block_core_latest_posts_no_priming() { $this->assertContains( self::$posts[0]->ID, $last_args[1], 'Ensure that post is in array of post ids that are primed' ); $this->assertNotContains( self::$sticky_post->ID, $last_args[1], 'Ensure that sticky post is not in array of post ids that are primed' ); } + + /** + * @covers ::render_block_core_latest_posts + */ + public function test_render_block_core_latest_posts_adds_layout_grid_compatibility_classes() { + $attributes = array( + 'displayFeaturedImage' => false, + 'postsToShow' => 5, + 'orderBy' => 'date', + 'order' => 'DESC', + 'excerptLength' => 0, + 'layout' => array( + 'type' => 'grid', + 'columnCount' => 4, + 'minimumColumnWidth' => '12rem', + ), + ); + + $markup = gutenberg_render_block_core_latest_posts( $attributes ); + + $this->assertStringContainsString( 'wp-block-latest-posts__list', $markup ); + $this->assertStringContainsString( 'is-grid', $markup ); + $this->assertStringContainsString( 'columns-4', $markup ); + $this->assertStringContainsString( 'has-native-responsive-grid', $markup ); + } + + /** + * @covers ::render_block_core_latest_posts + */ + public function test_render_block_core_latest_posts_supports_legacy_grid_attributes() { + $attributes = array( + 'displayFeaturedImage' => false, + 'postsToShow' => 5, + 'orderBy' => 'date', + 'order' => 'DESC', + 'excerptLength' => 0, + 'postLayout' => 'grid', + 'columns' => 5, + ); + + $markup = gutenberg_render_block_core_latest_posts( $attributes ); + + $this->assertStringContainsString( 'is-grid', $markup ); + $this->assertStringContainsString( 'columns-5', $markup ); + $this->assertStringNotContainsString( 'has-native-responsive-grid', $markup ); + } } From 70f9ffbcb2be6c7f5ae57f502d99c1a9be4a217e Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Mon, 18 May 2026 11:41:26 +1000 Subject: [PATCH 2/5] remove layout from migration --- packages/block-library/src/latest-posts/deprecated.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/block-library/src/latest-posts/deprecated.js b/packages/block-library/src/latest-posts/deprecated.js index e7f9e6ff631acb..61f7d540a62d4d 100644 --- a/packages/block-library/src/latest-posts/deprecated.js +++ b/packages/block-library/src/latest-posts/deprecated.js @@ -26,10 +26,10 @@ const migrateCategories = ( oldAttributes ) => { }; const migratePostLayout = ( oldAttributes ) => { - const { postLayout, columns, layout, ...attributesWithoutLegacyLayout } = + const { postLayout, columns, ...attributesWithoutLegacyLayout } = oldAttributes; - if ( layout || ! postLayout ) { + if ( ! postLayout ) { return oldAttributes; } @@ -57,7 +57,7 @@ export default [ }, migrate: ( oldAttributes ) => migratePostLayout( migrateCategories( oldAttributes ) ), - isEligible: ( { layout, postLayout } ) => ! layout && postLayout, + isEligible: ( { postLayout } ) => postLayout, save: () => null, }, { From 3927e08fdb6eb2bbe488ad16b0ad00a7dc3176aa Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Mon, 18 May 2026 12:01:22 +1000 Subject: [PATCH 3/5] rename test file --- .../{render-last-posts-test.php => render-latest-posts-test.php} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename phpunit/blocks/{render-last-posts-test.php => render-latest-posts-test.php} (100%) diff --git a/phpunit/blocks/render-last-posts-test.php b/phpunit/blocks/render-latest-posts-test.php similarity index 100% rename from phpunit/blocks/render-last-posts-test.php rename to phpunit/blocks/render-latest-posts-test.php From 7baaa3f4c0a862ca961673bd812627ea592b20cc Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Wed, 20 May 2026 16:39:39 +1000 Subject: [PATCH 4/5] add legacy attribs to deprecation --- docs/reference-guides/core-blocks.md | 2 +- .../block-library/src/latest-posts/block.json | 8 --- .../src/latest-posts/deprecated.js | 13 +++- .../src/latest-posts/test/deprecated.js | 59 +++++++++++++++++++ 4 files changed, 71 insertions(+), 11 deletions(-) diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md index 1135639445890c..36e627640a0fa8 100644 --- a/docs/reference-guides/core-blocks.md +++ b/docs/reference-guides/core-blocks.md @@ -463,7 +463,7 @@ Display a list of your most recent posts. ([Source](https://github.com/WordPress - **Name:** core/latest-posts - **Category:** widgets - **Supports:** align, anchor, color (background, gradients, link, text), interactivity (clientNavigation), layout, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~ -- **Attributes:** addLinkToFeaturedImage, categories, columns, displayAuthor, displayFeaturedImage, displayPostContent, displayPostContentRadio, displayPostDate, excerptLength, featuredImageAlign, featuredImageSizeHeight, featuredImageSizeSlug, featuredImageSizeWidth, order, orderBy, postLayout, postsToShow, selectedAuthor +- **Attributes:** addLinkToFeaturedImage, categories, displayAuthor, displayFeaturedImage, displayPostContent, displayPostContentRadio, displayPostDate, excerptLength, featuredImageAlign, featuredImageSizeHeight, featuredImageSizeSlug, featuredImageSizeWidth, order, orderBy, postsToShow, selectedAuthor ## List diff --git a/packages/block-library/src/latest-posts/block.json b/packages/block-library/src/latest-posts/block.json index fe86608f02413f..c12112bdf790f3 100644 --- a/packages/block-library/src/latest-posts/block.json +++ b/packages/block-library/src/latest-posts/block.json @@ -41,14 +41,6 @@ "type": "boolean", "default": false }, - "postLayout": { - "type": "string", - "default": "list" - }, - "columns": { - "type": "number", - "default": 3 - }, "order": { "type": "string", "default": "desc" diff --git a/packages/block-library/src/latest-posts/deprecated.js b/packages/block-library/src/latest-posts/deprecated.js index 61f7d540a62d4d..78639d23f48181 100644 --- a/packages/block-library/src/latest-posts/deprecated.js +++ b/packages/block-library/src/latest-posts/deprecated.js @@ -5,8 +5,16 @@ import metadata from './block.json'; const attributes = { ...metadata.attributes, - layout: { - type: 'object', +}; + +const legacyLayoutAttributes = { + postLayout: { + type: 'string', + default: 'list', + }, + columns: { + type: 'number', + default: 3, }, }; @@ -46,6 +54,7 @@ export default [ { attributes: { ...attributes, + ...legacyLayoutAttributes, categories: { type: [ 'array', 'string' ], }, diff --git a/packages/block-library/src/latest-posts/test/deprecated.js b/packages/block-library/src/latest-posts/test/deprecated.js index e71ca95084ab56..61bc268efd51a0 100644 --- a/packages/block-library/src/latest-posts/test/deprecated.js +++ b/packages/block-library/src/latest-posts/test/deprecated.js @@ -1,9 +1,34 @@ +/** + * WordPress dependencies + */ +import { + getBlockType, + parse, + registerBlockType, + unregisterBlockType, +} from '@wordpress/blocks'; + /** * Internal dependencies */ import deprecated from '../deprecated'; +import metadata from '../block.json'; describe( 'Latest Posts deprecations', () => { + beforeAll( () => { + if ( getBlockType( metadata.name ) ) { + unregisterBlockType( metadata.name ); + } + registerBlockType( metadata, { + deprecated, + save: () => null, + } ); + } ); + + afterAll( () => { + unregisterBlockType( metadata.name ); + } ); + it( 'migrates legacy grid layout attributes to layout support attributes', () => { const migratedAttributes = deprecated[ 0 ].migrate( { postLayout: 'grid', @@ -20,6 +45,40 @@ describe( 'Latest Posts deprecations', () => { } ); } ); + it( 'migrates legacy grid layout attributes using the legacy columns default', () => { + const migratedAttributes = deprecated[ 0 ].migrate( { + postLayout: 'grid', + columns: deprecated[ 0 ].attributes.columns.default, + postsToShow: 3, + } ); + + expect( migratedAttributes ).toEqual( { + layout: { + type: 'grid', + columnCount: 3, + }, + postsToShow: 3, + } ); + } ); + + it( 'parses legacy grid layout attributes to layout support attributes when columns are omitted', () => { + const [ parsedBlock ] = parse( + '' + ); + + expect( parsedBlock.attributes ).toEqual( + expect.objectContaining( { + layout: { + type: 'grid', + columnCount: 3, + }, + postsToShow: 3, + } ) + ); + expect( parsedBlock.attributes.postLayout ).toBeUndefined(); + expect( parsedBlock.attributes.columns ).toBeUndefined(); + } ); + it( 'preserves the legacy categories migration while migrating layout', () => { const migratedAttributes = deprecated[ 0 ].migrate( { categories: '7', From 601548dee07eece7f39ce4f7c2b1478fd9799b9d Mon Sep 17 00:00:00 2001 From: tellthemachines Date: Thu, 21 May 2026 15:22:43 +1000 Subject: [PATCH 5/5] update fixtures --- .../fixtures/blocks/core__latest-posts.json | 2 -- .../core__latest-posts__deprecated-v1.html | 1 + .../core__latest-posts__deprecated-v1.json | 25 +++++++++++++++++++ ...e__latest-posts__deprecated-v1.parsed.json | 15 +++++++++++ ...atest-posts__deprecated-v1.serialized.html | 1 + .../core__latest-posts__displayPostDate.json | 2 -- ...posts__displayPostDate__deprecated-v1.html | 1 + ...posts__displayPostDate__deprecated-v1.json | 25 +++++++++++++++++++ ...displayPostDate__deprecated-v1.parsed.json | 14 +++++++++++ ...layPostDate__deprecated-v1.serialized.html | 1 + 10 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.html create mode 100644 test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.json create mode 100644 test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.parsed.json create mode 100644 test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.serialized.html create mode 100644 test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.html create mode 100644 test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.json create mode 100644 test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.parsed.json create mode 100644 test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.serialized.html diff --git a/test/integration/fixtures/blocks/core__latest-posts.json b/test/integration/fixtures/blocks/core__latest-posts.json index dad331588a0a18..2a38604778acb2 100644 --- a/test/integration/fixtures/blocks/core__latest-posts.json +++ b/test/integration/fixtures/blocks/core__latest-posts.json @@ -9,8 +9,6 @@ "excerptLength": 55, "displayAuthor": false, "displayPostDate": false, - "postLayout": "list", - "columns": 3, "order": "desc", "orderBy": "date", "displayFeaturedImage": false, diff --git a/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.html b/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.html new file mode 100644 index 00000000000000..5b15e6f112f56b --- /dev/null +++ b/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.html @@ -0,0 +1 @@ + diff --git a/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.json b/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.json new file mode 100644 index 00000000000000..27ba7b6359bc95 --- /dev/null +++ b/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.json @@ -0,0 +1,25 @@ +[ + { + "name": "core/latest-posts", + "isValid": true, + "attributes": { + "postsToShow": 5, + "displayPostContent": false, + "displayPostContentRadio": "excerpt", + "excerptLength": 55, + "displayAuthor": false, + "displayPostDate": false, + "order": "desc", + "orderBy": "date", + "displayFeaturedImage": false, + "featuredImageSizeSlug": "thumbnail", + "featuredImageSizeWidth": null, + "featuredImageSizeHeight": null, + "addLinkToFeaturedImage": false, + "layout": { + "type": "default" + } + }, + "innerBlocks": [] + } +] diff --git a/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.parsed.json b/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.parsed.json new file mode 100644 index 00000000000000..718d65c846a770 --- /dev/null +++ b/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.parsed.json @@ -0,0 +1,15 @@ +[ + { + "blockName": "core/latest-posts", + "attrs": { + "postsToShow": 5, + "displayAuthor": false, + "displayPostDate": false, + "postLayout": "list", + "columns": 3 + }, + "innerBlocks": [], + "innerHTML": "", + "innerContent": [] + } +] diff --git a/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.serialized.html b/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.serialized.html new file mode 100644 index 00000000000000..10d72ddaf75735 --- /dev/null +++ b/test/integration/fixtures/blocks/core__latest-posts__deprecated-v1.serialized.html @@ -0,0 +1 @@ + diff --git a/test/integration/fixtures/blocks/core__latest-posts__displayPostDate.json b/test/integration/fixtures/blocks/core__latest-posts__displayPostDate.json index 429290bf129aee..50ce5f5d52fe76 100644 --- a/test/integration/fixtures/blocks/core__latest-posts__displayPostDate.json +++ b/test/integration/fixtures/blocks/core__latest-posts__displayPostDate.json @@ -9,8 +9,6 @@ "excerptLength": 55, "displayAuthor": false, "displayPostDate": true, - "postLayout": "list", - "columns": 3, "order": "desc", "orderBy": "date", "displayFeaturedImage": false, diff --git a/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.html b/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.html new file mode 100644 index 00000000000000..bfe276725849eb --- /dev/null +++ b/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.html @@ -0,0 +1 @@ + diff --git a/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.json b/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.json new file mode 100644 index 00000000000000..17a9e364ab5632 --- /dev/null +++ b/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.json @@ -0,0 +1,25 @@ +[ + { + "name": "core/latest-posts", + "isValid": true, + "attributes": { + "postsToShow": 5, + "displayPostContent": false, + "displayPostContentRadio": "excerpt", + "excerptLength": 55, + "displayAuthor": false, + "displayPostDate": true, + "order": "desc", + "orderBy": "date", + "displayFeaturedImage": false, + "featuredImageSizeSlug": "thumbnail", + "featuredImageSizeWidth": null, + "featuredImageSizeHeight": null, + "addLinkToFeaturedImage": false, + "layout": { + "type": "default" + } + }, + "innerBlocks": [] + } +] diff --git a/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.parsed.json b/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.parsed.json new file mode 100644 index 00000000000000..c5a83db7d1c676 --- /dev/null +++ b/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.parsed.json @@ -0,0 +1,14 @@ +[ + { + "blockName": "core/latest-posts", + "attrs": { + "postsToShow": 5, + "displayPostDate": true, + "postLayout": "list", + "columns": 3 + }, + "innerBlocks": [], + "innerHTML": "", + "innerContent": [] + } +] diff --git a/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.serialized.html b/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.serialized.html new file mode 100644 index 00000000000000..618e433e49262f --- /dev/null +++ b/test/integration/fixtures/blocks/core__latest-posts__displayPostDate__deprecated-v1.serialized.html @@ -0,0 +1 @@ +