-
If I have in my component, the representation of a block like: {
"clientId": "721d0ede-28d7-4e06-b430-18b594295865",
"name": "core/paragraph",
"isValid": true,
"attributes": {
"content": {},
"dropCap": false
},
"innerBlocks": []
} is there any function or method to transform this into the rendered html? For example, I would like to create a block that allows you use it's InnerBlocks to make snippets to save off to the database individually. |
Beta Was this translation helpful? Give feedback.
Answered by
talldan
Jul 16, 2024
Replies: 1 comment 1 reply
-
If you're running this programmatically (outside of the context of an editor), then I believe you'd also have to register the block types first ( |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
jakeparis
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
wp.blocks.serialize( blocks )
should do the job.If you're running this programmatically (outside of the context of an editor), then I believe you'd also have to register the block types first (
wp.blocks.registerBlockType
directly or by loading the block-library).