Ut_Tokens::ut_utuserimportedincourse_possible_tokens( array $tokens = array(), array $args = array() )

Add tokens to the triggers


Parameters Parameters

$tokens

(Optional)

Default value: array()

$args

(Optional)

Default value: array()


Top ↑

Return Return

(array)


Source Source

File: src/integrations/uncanny-toolkit/tokens/ut-tokens.php

	public function ut_utuserimportedincourse_possible_tokens( $tokens = array(), $args = array() ) {
		if ( ! automator_do_identify_tokens() ) {
			return $tokens;
		}
		$trigger_meta = $args['meta'];
		$new_tokens   = array();
		foreach ( self::$user_import_tokens as $token_id => $token_name ) {
			$new_tokens[] = array(
				'tokenId'         => $token_id,
				'tokenName'       => $token_name,
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_meta,
			);
		}
		$new_tokens[] = array(
			'tokenId'         => 'learndash_course_id',
			'tokenName'       => __( 'Course ID', 'uncanny-automator' ),
			'tokenType'       => 'int',
			'tokenIdentifier' => $trigger_meta,
		);

		return array_merge( $new_tokens, $tokens );
	}