Build a dynamic block using the default attributes

Question

My plugin uses a render callback function in PHP, to display the content of a block.
The block only stores the attributes that differ from the default values.

Is there a way to pass those default values into the render callback function in PHP?

I was thinking about putting a nonsense default value to one of the attributes, so if the edit function gets called for the first time it can overwrite them and give all of the attributes a default value.

But this seems to me rather hacky, is there a better way to do that?

0
Timo Giese 2 months 0 Answers 10 views 0

Leave an answer