Skip to content

Commit

Permalink
add example for query block and posts list (WordPress#63286)
Browse files Browse the repository at this point in the history
  • Loading branch information
MaggieCabrera authored and carstingaxion committed Jul 18, 2024
1 parent 8f7317b commit 601a7cf
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions packages/block-library/src/query/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,46 @@ export { metadata, name };
export const settings = {
icon,
edit,
example: {
viewportWidth: 650,
attributes: {
namespace: 'core/posts-list',
query: {
perPage: 4,
pages: 1,
offset: 0,
postType: 'post',
order: 'desc',
orderBy: 'date',
author: '',
search: '',
sticky: 'exclude',
inherit: false,
},
},
innerBlocks: [
{
name: 'core/post-template',
attributes: {
layout: {
type: 'grid',
columnCount: 2,
},
},
innerBlocks: [
{
name: 'core/post-title',
},
{
name: 'core/post-date',
},
{
name: 'core/post-excerpt',
},
],
},
],
},
save,
variations,
deprecated,
Expand Down

0 comments on commit 601a7cf

Please sign in to comment.