Affwp_Tokens::affwp_possible_affiliate_tokens( $tokens = array(),  $args = array() )


Source Source

File: src/integrations/affiliate-wp/tokens/affwp-tokens.php

	function affwp_possible_affiliate_tokens( $tokens = array(), $args = array() ) {

		$trigger_integration = $args['integration'];
		$trigger_meta        = $args['meta'];

		$metas = [ 'APPROVEDAFFILIATE', 'NEWAFFILIATE', 'APPROVALWAITING' ];

		if ( $trigger_integration === 'AFFWP' && in_array( $trigger_meta, $metas ) ) {
			$fields = [
				[
					'tokenId'         => 'AFFILIATEWPID',
					'tokenName'       => __( 'Affiliate ID', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPURL',
					'tokenName'       => __( 'Affiliate URL', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPSTATUS',
					'tokenName'       => __( 'Affiliate status', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPREGISTERDATE',
					'tokenName'       => __( 'Registration date', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPWEBSITE',
					'tokenName'       => __( 'Website', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPREFRATETYPE',
					'tokenName'       => __( 'Referral rate type', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPREFRATE',
					'tokenName'       => __( 'Referral rate', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPCOUPON',
					'tokenName'       => __( 'Dynamic coupon', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPACCEMAIL',
					'tokenName'       => __( 'Account email', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPPAYMENTEMAIL',
					'tokenName'       => __( 'Payment email', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPPROMOMETHODS',
					'tokenName'       => __( 'Promotion methods', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
				[
					'tokenId'         => 'AFFILIATEWPNOTES',
					'tokenName'       => __( 'Affiliate notes', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				],
			];
			$tokens = array_merge( $tokens, $fields );
		}

		return $tokens;
	}