Bbpress_Tokens::bb_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/bbpress/tokens/bbpress-tokens.php

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

		$trigger_meta = $args['meta'];
		if ( isset( $args['triggers_meta'] ) && ( 'ANONBBNEWTOPIC' === $args['triggers_meta']['code'] || 'BBNEWTOPIC' === $args['triggers_meta']['code'] ) ) {
			$fields = array(
				array(
					'tokenId'         => 'BBTOPIC_ID',
					'tokenName'       => __( 'Topic ID', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				),
				array(
					'tokenId'         => 'BBTOPIC_URL',
					'tokenName'       => __( 'Topic URL', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				),
				array(
					'tokenId'         => 'BBTOPIC',
					'tokenName'       => __( 'Topic title', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				),
				array(
					'tokenId'         => 'BBTOPIC_CONTENT',
					'tokenName'       => __( 'Topic content', 'uncanny-automator' ),
					'tokenType'       => 'text',
					'tokenIdentifier' => $trigger_meta,
				),
			);

			$tokens = array_merge( $tokens, $fields );
		}

		return $tokens;
	}