Home Forums Add-ons Flexible Content Field Modify flexible content block options on the fly Reply To: Modify flexible content block options on the fly

  • Is it sub fields in a layout that you want to add or do you want you want to add additional layouts.

    If it is the latter, adding layouts, this would be done better by removing layouts. You would create these layouts and they would be part of the flex field. Then you would create an acf/load_field filter, loop over the layouts and keep them or remove them based on what is being edited. I posted an extremely basic example of doing this here

    Adding additional fields would be more problematic. In this case you’d need to add these fields using PHP Although, you could probably use the same removal method as above but you’d need to loop over all of the fields in each layout as well and remove them.