New Poll Via API
-
Hi, I try to create a poll via API after submitting the specific form.
The issue is poll form name, poll answers created successfully, but in the settings (poll question, result behavior, result style) not created.add_action('forminator_form_after_handle_submit','generation_form', 10, 2 ); function generation_form($form_id, $response) { if ($response['success']){ if ($form_id == 60){ $answers = array( array( "title" => "Tester 1", "element_id" => "answer-1" ), array( "title" => "Tester 2", "element_id" => "answer-2", "use_extra" => 1, "extra" => "Tester" ), ); $settings = array( "poll-question" => "Test?", "results-behav" => "show_after", "results-style" => "bar", "enable-ajax" => "true", ); $id = Forminator_API::add_poll( "Does it work?", $answers, $settings ); } } }
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘New Poll Via API’ is closed to new replies.