AUTONAMI_TOKENS::add_list_tokens( mixed $tokens = array(), mixed $args = array() )

Method list_tokens


Parameters Parameters

$tokens

(Optional)

Default value: array()

$args

(Optional)

Default value: array()


Top ↑

Return Return

(void)


Source Source

File: src/integrations/autonami/tokens/autonami-tokens.php

	public function add_list_tokens( $tokens = array(), $args = array() ) {

		if ( ! automator_do_identify_tokens() ) {
			return $tokens;
		}

		if ( empty( $args['triggers_meta']['code'] ) ) {
			return $tokens;
		}

		$current_trigger = $args['triggers_meta']['code'];

		if ( ! in_array( $current_trigger, $this->get_list_triggers(), true ) ) {
			return $tokens;
		}

		$tokens[] = array(
			'tokenId'         => 'LIST_ID',
			'tokenName'       => __( 'List ID', 'uncanny-automator' ),
			'tokenType'       => 'text',
			'tokenIdentifier' => $current_trigger,
		);

		$tokens = $this->contact_tokens( $tokens, $current_trigger );

		if ( $this->is_userless( $current_trigger ) ) {
			$tokens = $this->additional_contact_tokens( $tokens, $current_trigger );
		}

		return $tokens;
	}