WPF_SUBFORM::wpform_submit( $fields,  $entry,  $form_data,  $entry_id )


Parameters Parameters

$fields

(Required)

$entry

(Required)

$form_data

(Required)

$entry_id

(Required)


Source Source

File: src/integrations/wpforms/triggers/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()->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_wp_form', $fields, $form_data, $recipes, $args );

		if ( $args ) {
			foreach ( $args as $result ) {
				if ( true === $result['result'] ) {
					Automator()->maybe_trigger_complete( $result['args'] );
				}
			}
		}
	}