diff --git a/docs/reference-guides/core-blocks.md b/docs/reference-guides/core-blocks.md
index f99e4785ac736a..36e627640a0fa8 100644
--- a/docs/reference-guides/core-blocks.md
+++ b/docs/reference-guides/core-blocks.md
@@ -462,8 +462,8 @@ 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~~
-- **Attributes:** addLinkToFeaturedImage, categories, columns, displayAuthor, displayFeaturedImage, displayPostContent, displayPostContentRadio, displayPostDate, excerptLength, featuredImageAlign, featuredImageSizeHeight, featuredImageSizeSlug, featuredImageSizeWidth, order, orderBy, postLayout, postsToShow, selectedAuthor
+- **Supports:** align, anchor, color (background, gradients, link, text), interactivity (clientNavigation), layout, spacing (blockGap, margin, padding), typography (fontSize, lineHeight), ~~html~~
+- **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 03de79be44ce71..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"
@@ -86,6 +78,7 @@
"anchor": true,
"align": true,
"html": false,
+ "layout": true,
"color": {
"gradients": true,
"link": true,
@@ -97,7 +90,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..78639d23f48181 100644
--- a/packages/block-library/src/latest-posts/deprecated.js
+++ b/packages/block-library/src/latest-posts/deprecated.js
@@ -3,27 +3,84 @@
*/
import metadata from './block.json';
-const { attributes } = metadata;
+const attributes = {
+ ...metadata.attributes,
+};
+
+const legacyLayoutAttributes = {
+ postLayout: {
+ type: 'string',
+ default: 'list',
+ },
+ columns: {
+ type: 'number',
+ default: 3,
+ },
+};
+
+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, ...attributesWithoutLegacyLayout } =
+ oldAttributes;
+
+ if ( ! postLayout ) {
+ return oldAttributes;
+ }
+
+ return {
+ ...attributesWithoutLegacyLayout,
+ layout: {
+ type: postLayout === 'grid' ? 'grid' : 'default',
+ ...( postLayout === 'grid' && columns && { columnCount: columns } ),
+ },
+ };
+};
export default [
{
attributes: {
...attributes,
+ ...legacyLayoutAttributes,
categories: {
- type: 'string',
+ type: [ 'array', 'string' ],
},
},
supports: {
align: true,
html: false,
+ layout: true,
+ },
+ migrate: ( oldAttributes ) =>
+ migratePostLayout( migrateCategories( oldAttributes ) ),
+ isEligible: ( { postLayout } ) => 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..61bc268efd51a0
--- /dev/null
+++ b/packages/block-library/src/latest-posts/test/deprecated.js
@@ -0,0 +1,97 @@
+/**
+ * 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',
+ columns: 4,
+ postsToShow: 3,
+ } );
+
+ expect( migratedAttributes ).toEqual( {
+ layout: {
+ type: 'grid',
+ columnCount: 4,
+ },
+ postsToShow: 3,
+ } );
+ } );
+
+ 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',
+ 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-latest-posts-test.php
similarity index 67%
rename from phpunit/blocks/render-last-posts-test.php
rename to phpunit/blocks/render-latest-posts-test.php
index f26da1cfa6724b..a6813f2c438a0f 100644
--- a/phpunit/blocks/render-last-posts-test.php
+++ b/phpunit/blocks/render-latest-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 );
+ }
}
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 @@
+