Adding custom attribute to freeform (classic) block
-
I created a custom attribute that will append a margin class to every Gutenberg custom & core block through a SelectControl field with several options in the sidebar. This works perfectly for most blocks, but not for the freeform block.
The property appears in the sidebar when the freeform block was chosen, but it is not possible to save the value of this attribute when I save the page & reload the editor in the browser.
The values does appear on the frontend once the block is being rendered, but if we then choose to change the size of the margin, it sort of puts a second wrapper around this block and appends both margin classes.
The value is being appended through a filter and the “createHigherOrderComponent”.
Does anyone know a solution to this problem on how we can save this custom attribute?
- The topic ‘Adding custom attribute to freeform (classic) block’ is closed to new replies.