Uncanny_Toolkit_Helpers::build_token_data( array $values, array $headers, array $keys, int $user_id )

Building default tokens for the triggers


Parameters Parameters

$values

(Required)

$headers

(Required)

$keys

(Required)

$user_id

(Required)


Top ↑

Return Return

(array|false)


Source Source

File: src/integrations/uncanny-toolkit/helpers/uncanny-toolkit-helpers.php

	public static function build_token_data( $values, $headers, $keys, $user_id ) {

		$courses      = self::get_courses_from_data( $values, $keys );
		$groups       = self::get_groups_from_data( $values, $keys );
		$group_leader = self::get_group_leader_from_data( $values, $keys );
		$combine      = array_combine( $headers, $values );

		$combine['learndash_course_titles']       = $courses['course_titles'];
		$combine['learndash_course_ids']          = $courses['course_ids'];
		$combine['learndash_group_titles']        = $groups['group_titles'];
		$combine['learndash_group_ids']           = $groups['group_ids'];
		$combine['learndash_group_leader_titles'] = $group_leader['group_titles'];
		$combine['learndash_group_leader_ids']    = $group_leader['group_ids'];
		$combine['user_id']                       = $user_id;

		return $combine;
	}