Add multiple fields to a custom block1 user found helpful
I would like to create a custom block in which you can dynamically add fields of the same type when adding/editing the block just like you can do in the standard blocks form, survey & slideshow. However, I have trouble finding how to do this.
I have understood that I have to override the save($args) function and instead save an array of the added fields.
Does any one know how to do this, of a tutorial or have a good example block to learn from?
Any input is appreciated!
I do wish that there were some kind of built-in library or widget that helped with this (it's on my extremely long todo list, so maybe in 5 years there will be ;)
The best I can do here is explain at a high level how you'd approach it: