2
votes
Code Display Options For Dynamic HTML Blocks
I was building a code snippets site where I share code fragments that can be re-used by others. Then I got into the problem to build the custom post type single template as I could not assign a CPT repeater field (Text area) which contains a PHP/JS/HTML code to display in the frontend. So I end up building a shortcode to sanitize and display code – along with a "copy code" function for each snippet, for now it works, but I think this can be extended in a visual way by extending the class / wrapper and options to display copy code option. Hopefully we will see this in the near future.
Live demo of what I wanted to achieve (https://send2.link/c0r36n) by using k-blocks – but right now, I use a shortcode for it.
The support (boon) provided additional code to extend the Dynamic HTML object via a code. I will test it out and see if I can add the copy code button. But if it is native, with syntax highlights – would be just amazing.


