Skip to content

Instantly share code, notes, and snippets.

@TimBHowe
Last active August 29, 2015 13:58
Show Gist options
  • Save TimBHowe/10131068 to your computer and use it in GitHub Desktop.
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
<?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