Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 4 additions & 1 deletion lib/class-wp-theme-json-gutenberg.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ class WP_Theme_JSON_Gutenberg {
'palette' => null,
),
'custom' => null,
'layout' => null,
'layout' => array(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think later we'll have "type" and a different shape of layout depending of the "type". Maybe it's fine for now to have this but I thought I'd mention in case it's any impactful.

@oandregal oandregal Jul 9, 2021 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When/If we have those new fields we can add them all and/or have some specific logic for layout to make sure only the ones that make sense depending on type are allowed.

By porting this to WordPress core we won't allow anything else than what it's shipped in v1 (the two fields in use atm) without the plugin. With the plugin, consumers will have those new things available. Makes sense?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WFM 👍

'contentSize' => null,
'wideSize' => null,
),
'spacing' => array(
'customMargin' => null,
'customPadding' => null,
Expand Down
7 changes: 7 additions & 0 deletions phpunit/class-wp-theme-json-test.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ function test_get_settings() {
'color' => array(
'custom' => false,
),
'layout' => array(
'contentSize' => 'value',
'invalid/key' => 'value',
),
'invalid/key' => 'value',
'blocks' => array(
'core/group' => array(
Expand Down Expand Up @@ -44,6 +48,9 @@ function test_get_settings() {
'color' => array(
'custom' => false,
),
'layout' => array(
'contentSize' => 'value',
),
'blocks' => array(
'core/group' => array(
'color' => array(
Expand Down