Wc_Tokens::wc_possible_tokens( array $tokens = array(), array $args = array(), string $type = 'order' )
Parameters Parameters
- $tokens
-
(Optional)
Default value: array()
- $args
-
(Optional)
Default value: array()
- $type
-
(Optional)
Default value: 'order'
Return Return
(array)
Source Source
File: src/integrations/woocommerce/tokens/wc-tokens.php
public function wc_possible_tokens( $tokens = array(), $args = array(), $type = 'order' ) { $fields = array(); $trigger_meta = $args['meta']; $possible_tokens = apply_filters( 'automator_woocommerce_possible_tokens', $this->possible_order_fields ); foreach ( $possible_tokens as $token_id => $input_title ) { if ( 'billing_email' === (string) $token_id || 'shipping_email' === (string) $token_id ) { $input_type = 'email'; } else { $input_type = 'text'; } $fields[] = [ 'tokenId' => $token_id, 'tokenName' => $input_title, 'tokenType' => $input_type, 'tokenIdentifier' => $trigger_meta, ]; } $tokens = array_merge( $tokens, $fields ); return $tokens; }
Expand full source code Collapse full source code View on Github