Wpwh_Helpers::extract_and_save_data( $params,  $args )


Parameters Parameters

$entry_id

(Required)

$form_id

(Required)

$args

(Required)


Top ↑

Return Return

(array)


Source Source

File: src/integrations/wp-webhooks/helpers/wpwh-helpers.php

	public function extract_and_save_data( $params, $args ) {
		$data = $params;

		$trigger_id     = (int) $args['trigger_id'];
		$user_id        = (int) $args['user_id'];
		$trigger_log_id = (int) $args['trigger_log_id'];
		$run_number     = (int) $args['run_number'];
		$meta_key       = (string) $args['meta_key'];

		if ( $data ) {

			$insert = [
				'user_id'        => $user_id,
				'trigger_id'     => $trigger_id,
				'trigger_log_id' => $trigger_log_id,
				'meta_key'       => $meta_key,
				'meta_value'     => maybe_serialize( $data ),
				'run_number'     => $run_number,
			];

			Automator()->insert_trigger_meta( $insert );
		}

		return $data;
	}