Connecting WPforms to php code using code snippet
-
Hello, I want to connect the result of form, to pass it to an API, and then display the result of the API. In order to do this, I have a 3 steps plan :
- Create a form with WPforms and note its ID
- Write the php code with the snippet plugin code that gather WP form data, make an api call and display it
- Instantiate the WPform on my page, and paste in the following block the snippet code so that it is evaluated
First, for testing purpose I only want to display the result of the form so I wrote the following code :
function be_crm_display_raw_form_data( $fields, $entry, $form_data, $entry_id ) {
echo "<pre>";
print_r( $fields );
echo "</pre>";
}
add_action( 'wpforms_process_complete', 'be_crm_display_raw_form_data', 10, 4 );But after filling the form on preview page and hitting submit, nothing shows up. Can you please point to me what I am doing wrong.
Thanks in advance for your answer
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.