Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Loop: Change default query loop variations #63353

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 4 additions & 20 deletions packages/block-library/src/query/variations.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,6 @@ import {
imageDateTitle,
} from './icons';

const QUERY_DEFAULT_ATTRIBUTES = {
query: {
perPage: 3,
pages: 0,
offset: 0,
postType: 'post',
order: 'desc',
orderBy: 'date',
author: '',
search: '',
exclude: [],
sticky: '',
inherit: false,
},
};

const variations = [
{
name: 'posts-list',
Expand Down Expand Up @@ -60,7 +44,7 @@ const variations = [
name: 'title-date',
title: __( 'Title & Date' ),
icon: titleDate,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES },
attributes: {},
innerBlocks: [
[
'core/post-template',
Expand All @@ -76,7 +60,7 @@ const variations = [
name: 'title-excerpt',
title: __( 'Title & Excerpt' ),
icon: titleExcerpt,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES },
attributes: {},
innerBlocks: [
[
'core/post-template',
Expand All @@ -92,7 +76,7 @@ const variations = [
name: 'title-date-excerpt',
title: __( 'Title, Date, & Excerpt' ),
icon: titleDateExcerpt,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES },
attributes: {},
innerBlocks: [
[
'core/post-template',
Expand All @@ -112,7 +96,7 @@ const variations = [
name: 'image-date-title',
title: __( 'Image, Date, & Title' ),
icon: imageDateTitle,
attributes: { ...QUERY_DEFAULT_ATTRIBUTES },
attributes: {},
innerBlocks: [
[
'core/post-template',
Expand Down
Loading