Skip to content

Deprecate a block #37744

Answered by talldan
Suriteka asked this question in Q&A
Jan 6, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

That's a good question. I don't think there's a reliable way to do this. The problem is that RichText is naturally less capable than InnerBlocks, so you won't be able to reliably convert from inner blocks to rich text without some data loss.

The amount of data loss really depends on the makeup of your inner blocks in the old version of your block.

If the block was completely freeform and any block was allowed to be added as an inner block, then it becomes a bit tricky. Your best bet is to use migrate in the deprecation. You get access to the inner blocks as the second param to that function. Your challenge will be to assemble those inner blocks into a content string. You could probably st…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Suriteka
Comment options

Answer selected by Suriteka
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
[Feature] Block Validation/Deprecation Handling block validation to determine accuracy and deprecation
2 participants