On the front end, I need access to the block’s attributes so I can use those in building the front end block. Instead of rendering the block as normal (either as a dynamic block or saved html), I’ll put in a filter to render something which looks like this:
Filter the content to put an Gutenberg editor block’s attributes on the front end (part 3 of 4)
The filter I’ll use is
render_block. I don’t want to register the block as a server side render because that will affect the editor, so I’ll just hijack it here. Plus it’s a bit more straightforward to me.
I’ve added that to the plugin.php and that’s all I need to do to get the block html on the front end as I’d like it!
Posts on this
Join the newsletter
Subscribe to get the latest content by email.
Powered by ConvertKit. If you give me your email address, you may receive emails from me (JJ) about posts on this site. You can unsubscribe at any time.