Skip to content

Commit

Permalink
Fix paragraph content default attribute (#181)
Browse files Browse the repository at this point in the history
* Fix: Add missing default value for CoreParagraph Block

* Chore: Add Changeset

* Fix: Add missing default value in content attribute for CoreCode

* Update spotty-nails-complain.md
  • Loading branch information
theodesp authored Jan 29, 2024
1 parent 53e871b commit f15f95c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/spotty-nails-complain.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@wpengine/wp-graphql-content-blocks": major
---

Adds missing default value for content attribute CoreParagraph and CoreCode blocks. This will make the type of the content field `String!` instead of `String`
6 changes: 6 additions & 0 deletions includes/Blocks/CoreCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,11 @@ class CoreCode extends Block {
'source' => 'attribute',
'attribute' => 'class',
],
'content' => [
'type' => 'string',
'selector' => 'code',
'source' => 'html',
'default' => '',
],
];
}
1 change: 1 addition & 0 deletions includes/Blocks/CoreParagraph.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ class CoreParagraph extends Block {
'type' => 'string',
'selector' => 'p',
'source' => 'html',
'default' => '',
],
];
}

0 comments on commit f15f95c

Please sign in to comment.