ANON_WPF_SUBFORM::wpform_submit( $fields, $entry, $form_data, $entry_id )
Validation method.
Contents
Parameters Parameters
- $fields
-
(Required)
- $entry
-
(Required)
- $form_data
-
(Required)
- $entry_id
-
(Required)
Source Source
File: src/integrations/wpforms/triggers/anon-wpf-subform.php
public function wpform_submit( $fields, $entry, $form_data, $entry_id ) { if ( empty( $form_data ) ) { return; } $user_id = get_current_user_id(); $args = [ 'code' => $this->trigger_code, 'meta' => $this->trigger_meta, 'post_id' => intval( $form_data['id'] ), 'user_id' => $user_id, ]; $args = Automator()->process->user->maybe_add_trigger_entry( $args, false ); //Adding an action to save form submission in trigger meta $recipes = Automator()->get->recipes_from_trigger_code( $this->trigger_code ); do_action( 'automator_save_anon_wp_form', $fields, $form_data, $recipes, $args ); if ( $args ) { foreach ( $args as $result ) { if ( true === $result['result'] ) { Automator()->process->user->maybe_trigger_complete( $result['args'] ); } } } }
Expand full source code Collapse full source code View on Github