Closed iuravic closed 5 years ago
As far as I can tell, the latest comment on #13163 is still accurate. What differentiates your ticket from that issue?
The two Issues address the same point; just that since Issue #13163 was closed, with this new one I was simply hoping for an up-to-date confirmation that to use node was still the recommended path (to implement the conversion in the backend).
And so thank you for confirming this, Pascal! I'll proceed with the suggested method.
Why are these all closed, and after 5 years still no method to solve this, yet they still expect everybody to happily jump on the Gutenberg train like these major gaps in coverage don't exist.
Hello!
I would kindly ask for advice on how to best implement the conversion of classic/pre-Gutenberg post content to blocks as a backend functionality. The need arises from multiple websites which need their old content converted to blocks (it is a significant number of sites, some with ~50,000 posts in history).
As far as I researched (from the Gutenberg Issues, PRs, and WP Code Reference), this functionality is currently not yet available in the backend. So I would kindly appreciate any advices and suggestions on how to provide/implement this functionality via a backend endpoint/function.
The one current idea so far comes from this comment in Convert to blocks in PHP #13163 suggesting to "... use a node script running jsdom and use the wp.blocks.rawHandler function ...".
For now, I’ve only triggered the conversion of the content in the frontend programmatically, in a local installation of the Gutenberg in a VVV site -- very crudely, what I did was something in the lines of:
select("core/editor") > getBlocks() > dispatch().replaceBlocks)
.