hollosipeter

Forminator Webhook

May 5th, 2023
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.14 KB | Source Code | 0 0
  1. /*
  2. Plugin Name: Custom Forminator Endpoint
  3. */
  4.  
  5. add_action( 'admin_post_nopriv_submit_form_data', 'submit_form_data' );
  6. add_action( 'admin_post_submit_form_data', 'submit_form_data' );
  7.  
  8. function submit_form_data() {
  9.         $form_id = 23868; // Az Ön Forminator űrlapjának azonosítója
  10.     $form_entry = array(
  11.         'data' => array(
  12.             array(
  13.                 'name' => 'email-1',
  14.                 'value' => $_POST['email-1']
  15.             ),
  16.             array(
  17.                 'name' => 'text-1',
  18.                 'value' => $_POST['text-1']
  19.             ),
  20.             array(
  21.                 'name' => 'text-2',
  22.                 'value' => $_POST['text-2']
  23.             ),
  24.             array(
  25.                 'name' => 'date-1',
  26.                 'value' => $_POST['date-1']
  27.             ),
  28.             array(
  29.                 'name' => 'text-3',
  30.                 'value' => $_POST['text-3']
  31.             ),
  32.             array(
  33.                 'name' => 'hidden-3',
  34.                 'value' => $_POST['hidden-3']
  35.             )
  36.         )
  37.     );
  38.  
  39.     $form_entry_id = Forminator_API::submit_form_entry( $form_id, $form_entry );
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment