Last active
August 29, 2015 13:58
-
-
Save TimBHowe/10131068 to your computer and use it in GitHub Desktop.
Add a dropdown list of the current forms in gravity forms add-on API
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 | |
public function plugin_settings_fields() { | |
//collect the forms for the array options | |
$forms = RGFormsModel::get_forms(); | |
$choices = array(); | |
foreach($forms as $form){ | |
$choices[] = array("label" => esc_html($form->title),"value" => absint($form->id)); | |
} | |
return array( | |
array( | |
"title" => "Protected Downloads Form", | |
"fields" => array( | |
array( | |
"label" => "Form Select", | |
"type" => "select", | |
"name" => "protect_form", | |
"tooltip" => "Selecte the from that you would like to have protect the download and capture the lead.", | |
"choices" => $choices | |
) | |
) | |
) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment