@@ -400,7 +400,15 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
400
400
</ InspectorControls >
401
401
) ;
402
402
403
- const blockProps = useBlockProps ( ) ;
403
+ const blockProps = useBlockProps ( {
404
+ className : classnames ( {
405
+ 'wp-block-latest-posts__list' : true ,
406
+ 'is-grid' : postLayout === 'grid' ,
407
+ 'has-dates' : displayPostDate ,
408
+ 'has-author' : displayAuthor ,
409
+ [ `columns-${ columns } ` ] : postLayout === 'grid' ,
410
+ } ) ,
411
+ } ) ;
404
412
405
413
const hasPosts = Array . isArray ( latestPosts ) && latestPosts . length ;
406
414
if ( ! hasPosts ) {
@@ -442,20 +450,12 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
442
450
const dateFormat = __experimentalGetSettings ( ) . formats . date ;
443
451
444
452
return (
445
- < div { ... blockProps } >
453
+ < >
446
454
{ inspectorControls }
447
455
< BlockControls >
448
456
< ToolbarGroup controls = { layoutControls } />
449
457
</ BlockControls >
450
- < ul
451
- className = { classnames ( {
452
- 'wp-block-latest-posts__list' : true ,
453
- 'is-grid' : postLayout === 'grid' ,
454
- 'has-dates' : displayPostDate ,
455
- 'has-author' : displayAuthor ,
456
- [ `columns-${ columns } ` ] : postLayout === 'grid' ,
457
- } ) }
458
- >
458
+ < ul { ...blockProps } >
459
459
{ displayPosts . map ( ( post , i ) => {
460
460
const titleTrimmed = invoke ( post , [
461
461
'title' ,
@@ -585,6 +585,6 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
585
585
) ;
586
586
} ) }
587
587
</ ul >
588
- </ div >
588
+ </ >
589
589
) ;
590
590
}
0 commit comments