Skip to content

Instantly share code, notes, and snippets.

@gwin
Last active November 4, 2015 11:49
Show Gist options
  • Save gwin/c7cf03ccc1b1c23eafad to your computer and use it in GitHub Desktop.
Save gwin/c7cf03ccc1b1c23eafad to your computer and use it in GitHub Desktop.
<?php
add_filter("wpjb_form_init_alert", "my_form_init_alert");
function my_form_init_alert($form) {
$e = $form->create("frequency", "select");
$e->addOption("1", "1", "Daily");
$e->addOption("2", "2", "Weekly");
$e->addClass("wpjb-widget-alert-frequency");
$form->addElement($e, "alert");
$e = $form->create("location");
$e->setAttr("placeholder", "Location");
$e->addClass("wpjb-widget-alert-param");
$form->addElement($e, "alert");
wp_enqueue_script("wpjb-vendor-selectlist");
$e = $form->create("category", "select");
$e->addOptions(wpjb_form_get_categories());
$e->setEmptyOption(true);
$e->setMaxChoices(10);
$form->addElement($e, "alert");
return $form;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment