Modify form with PHP
-
Dear all,,
I well understand that Ninja Forms support does not address code issue.
I post here in case of the Ninja Forms community could help me. ??
I am trying to create and modify forms with PHP.
Creating an empty form with this code works well (the new form appears in the admin panel):
https://developer.ninjaforms.com/codex/forms/
<?php /* * Create a Form */ $form = Ninja_Forms()->form()->get(); $form->update_setting( 'title', 'Contact Me' ); $form->save();
Nevertheless, I am trying to add a field in an existing form with this code and I am not able to make it work… :
https://developer.ninjaforms.com/codex/fields/
/* * Create a Field */ $field = Ninja_Forms()->form( 12 )->field()->get(); $field->update_settings( 'type', 'textbox' )->save();
Can anyone tell me what I am doing wrong ?
Thank you
Xerviami
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Modify form with PHP’ is closed to new replies.