So you mean have it render on the server, or something else? If so, it’s not possible because the block renders in the browser (as you type), and not on the server.
Hi Kevin
Thank you, some more context to what I am trying to achieve.
I have a block template website where I provide block editor code so a user can just copy the code and paste it directly into the WP block editor.
You can see the example template here > https://gstemplates.com/design/feature-beta/
So under the Get the Code accordion, you’ll see I have added code in the Code Block for that specific template design.
I am doing this all manually and I want to be able to use an ACF field (text or WYSIWG in text mode or other) to then have that code display dynamically in the code block. So that way I can create a custom post type template and just use fields to populate the data instead of adding the Get the Code accordion block in manually each time.
Hope that makes sense.
Yeah it’s just not possible, unfortunately. The code is processed through in webassembly so it’s not likely it will ever be possible either unless I added an entire runtime to the plugin. The only way you could automate it is with some sort of CI script that opens the page in a browser, edits it, processes it, the persists it somewhere. You could do that with something like playwright or cypress.
Totally understandable and thanks for clarifying Kevin. Much appreciated for your speedy replies 🙂