I am using carbon fields for a wordpress plugin. The problem is that in the options there should be an undefined number of inputs.
For instance (this is a simplification), in the settings there is "people", where the developer can specify more than one people.
For instance, the fields should be:
- Name
Surname
x (delete)
- Name
Surname
x (delete)
+ (add new person)
When + is clicked, new fields Name, Surname, x should appear.
My code is now something like:
Container::make('theme_options', 'XXX')
->set_page_parent('options-general.php')
->add_tab( 'People', array(
Field::make('text', 'xxx_name', 'Name'),
Field::make('text', 'xxx_surname', 'Surname')
))
I want that the configuration is stored in an array
There is already the complex field in carbon fields.
This is the link to the documentation page
In my case it would be something like: