Uc_Tokens::uc_codes_possible_tokens( array $tokens = array(), array $args = array() )


Parameters Parameters

$tokens

(Optional)

Default value: array()

$args

(Optional)

Default value: array()


Top ↑

Return Return

(array)


Source Source

File: src/integrations/uncanny-codes/tokens/uc-tokens.php

	public function uc_codes_possible_tokens( $tokens = array(), $args = array() ) {
		if ( ! automator_do_identify_tokens() ) {
			return $tokens;
		}
		$trigger_code = $args['triggers_meta']['code'];
		$fields = array(
			array(
				'tokenId'         => 'UNCANNYCODESBATCH_ID',
				'tokenName'       => __( 'Batch ID', 'uncanny-automator' ),
				'tokenType'       => 'int',
				'tokenIdentifier' => $trigger_code,
			),
			array(
				'tokenId'         => 'UNCANNYCODESTYPE',
				'tokenName'       => __( 'Type', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_code,
			),
			array(
				'tokenId'         => 'UNCANNYCODESPREFIXBATCH',
				'tokenName'       => __( 'Prefix', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_code,
			),
			array(
				'tokenId'         => 'UNCANNYCODESSUFFIXBATCH',
				'tokenName'       => __( 'Suffix', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_code,
			),
			array(
				'tokenId'         => 'UNCANNYCODESLD_TYPE',
				'tokenName'       => __( 'LD Type', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_code,
			),
			array(
				'tokenId'         => 'UNCANNYCODESMAX_PER_CODE',
				'tokenName'       => __( 'Max per code', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_code,
			),
			array(
				'tokenId'         => 'UNCANNYCODESCODES_GENERATED',
				'tokenName'       => __( 'Codes Generated', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_code,
			),
			array(
				'tokenId'         => 'UNCANNYCODESEXPIRY_DATE',
				'tokenName'       => __( 'Expiry date', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_code,
			),
			array(
				'tokenId'         => 'UNCANNYCODESLIST_OF_CODES',
				'tokenName'       => __( 'Codes (CSV list of codes)', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_code,
			),
		);
		$tokens = array_merge( $tokens, $fields );
		return $tokens;
	}