Filter post_content before loading in Gutenberg editor
I found that there is no way to change the data which is coming to editor when it is loaded. But it’s possible to replace the data after that. JS: script.js wp.domReady(function () { const newData = window.myNewBlocksData; if (newData) { wp.data.dispatch(‘core/block-editor’).resetBlocks(wp.blocks.parse(newData)); console.log(‘replaced’); } }) PHP: <?php class MyBlocksManipulation { public $prefix = ‘my’; public … Read more