If you have a dynamic gutenberg block, and in the PHP render_callback
, your code includes a custom query and loop, then it will break the editor.
This test plugin demonstrates the issue.
- Create a new page.
- Add the 'Demo Dynamic Post Block' block
- Add one or more image IDs. Comma separated (e.g.
12, 523
) - Save a draft.
- If you preview the page - this will work as expected. You will see the image titles and IDs.
- If you reload the page in the editor, the page will break with the following JS error: