Last active
October 28, 2015 20:41
-
-
Save kjohnson/59c4a009960b59a87f5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* Create a Form | |
*/ | |
$form = Ninja_Forms()->form()->get(); | |
$form->update_setting( 'title', 'Contact Me' ); | |
$form->save(); | |
/* | |
* Create a Form with an array of Settings | |
*/ | |
$settings = array( | |
'title' => 'Contact Me' | |
); | |
$form = Ninja_Forms()->form()->get(); | |
$form->update_settings( $settings )->save(); | |
/* | |
* Update a Form | |
*/ | |
$form = Ninja_Forms()->form( 1 )->get(); | |
$form->update_setting( 'title', 'Contact Me' ); | |
$form->save(); | |
/* | |
* Update a Form with an array of Settings | |
*/ | |
$settings = array( | |
'title' => 'Contact Me' | |
); | |
$form = Ninja_Forms()->form( 1 )->get(); | |
$form->update_settings( $settings )->save(); | |
/* | |
* Loop through Forms | |
*/ | |
$forms = Ninja_Forms()->form()->get_forms(); | |
foreach( $forms as $form ){ | |
// Do Stuff Here | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment