I am building a module that has a nav menu that filters and displays content boxes. The list is built, item by item, in the module admin panel. Each content box is built within the module, and I would like to be able to have a dropdown menu within the content box builder form that is dynamically generated from the list items created previously.
This is what I’ve put together…didn’t work. Am I moving in the right direction and just have syntax errors or is this completely wrong?
It does look like you have some syntax errors. Specifically, I don’t think you can do a for statement within an array like that. Your best bet will most likely be to create a custom field. Have you looked at how to do that in the module docs?
To extend my previous question – just like the OP I’d like to create an array of options based on input from other fields, and use them in a custom field.
The problem is that my custom field is in a (multiple) form inside a form, and $settings available in the control is limited to that forms settings, and not the full $settings object. Same thing when using fl_builder_render_settings_field filter.
Is there a way to get the parent $settings? If not, could you add the parent $settings as another var included in the fl_builder_control_* action?
Yes an no. $settings only displays the current form settings, so if it is a form within a form, I’m missing the parent form $settings. I guess I could use the update function to push an array of options to all child forms, but that seems silly.
Ah, crap. The only thing is that most of the builder JS is now concatenated and minified in fl-builder.min.js unless you have WP_DEBUG on. If you have that on, you can add this below line 5533 of fl-builder.js…