Is it possible to import additional fields into an existing form using the XML import feature?
Is it possible to import additional fields into an existing form using the XML import feature?
I can't think of any way to do this automatically. What use case do you have that requires this?
I have some standard hidden fields I use for tracking that I would like to easily add to my existing forms and forms I create in the future. Creating the hidden fields by hand in the UI is slow work.
I don't know of a programmatic way to do this. Is the hidden field always different, but the tracking code stored therein different for each form or site?
Since the field is always present in the form, how about adding to functions.php something that will pre-populate the field with the unique information, based on form ID? Without knowing what information is being stored, and how it's different, it's hard to provide specifics. But you'd have to add some code to add new fields on import, so this would likely be the same amount of work, it would just be to populate the field value, for a field which is already present, rather than modify a form on import.
That would be less efficient, pre-populating a field value every time the form is rendered, but I'm just thinking out loud, generically.