Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic Rendering with render_block #335

Open
dcooney opened this issue Aug 23, 2024 · 2 comments
Open

Dynamic Rendering with render_block #335

dcooney opened this issue Aug 23, 2024 · 2 comments

Comments

@dcooney
Copy link
Contributor

dcooney commented Aug 23, 2024

I'm curious if there is a way to render a code block dynamically with render_block()?

I have an ACF textarea field with a code snippet and I want to render this snippet with Code Block Pro in a lightbox.

<ul>
    <li>List Item #1</li>
    <li>List Item #2</li>
    <li>List Item #3</li>
</ul>

I've been inspecting how the plugin transforms the code into encoded string and span elements within the Code Editor and not sure if this is possible.

@KevinBatdorf
Copy link
Owner

Unfortunately it's not because it runs in the browsers webassembly runtime. I also don't know enough about ACF to know if it could hack something in the browser for it either.

@dcooney
Copy link
Contributor Author

dcooney commented Aug 23, 2024

All good. I didn't think it was possible.
ACF was just an example, basically, I was hoping to be able to use Code Block Pro for content outside of the Block Editor which you can do with render_block.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants