Skip to content

Handling dynamic blocks in Faust #1754

Answered by theodesp
calebsmithdev asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @calebsmithdev . Regarding the new blockSet command my understanding is that you can make a component dynamic by returning a null Save function.

When you use the registerFaustBlock function you can optionally pass a Save Function here

registerFaustBlock(Block, {metadata, saveFn: () => null})

On the other hand in the WordPress side you need to provide a renderCallback function when registering a dynamic block.

In our plugin we do use the register_block_type function in this section of the code:

I suppose we could allow for a custom filter to run so that users can include their own renderCallbacks maybe something like:

$block_args = apply_filters( 'faustwp_get_block_args', $block_args, $b…

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@calebsmithdev
Comment options

@theodesp
Comment options

@calebsmithdev
Comment options

@theodesp
Comment options

Answer selected by calebsmithdev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants