Wp_Post_Tokens::wp_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/wp/tokens/wp-post-tokens.php

	public function wp_possible_tokens( $tokens = array(), $args = array() ) {
		if ( ! automator_do_identify_tokens() ) {
			return $tokens;
		}
		$trigger_integration = $args['integration'];
		$trigger_meta        = $args['meta'];
		$fields = array(
			array(
				'tokenId'         => 'POSTTITLE',
				'tokenName'       => __( 'Post title', 'uncanny-automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_meta,
			),
			array(
				'tokenId'         => 'POSTID',
				'tokenName'       => __( 'Post ID', 'uncanny_automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_meta,
			),
			array(
				'tokenId'         => 'POSTURL',
				'tokenName'       => __( 'Post URL', 'uncanny-automator' ),
				'tokenType'       => 'url',
				'tokenIdentifier' => $trigger_meta,
			),
			array(
				'tokenId'         => 'POSTCONTENT',
				'tokenName'       => __( 'Post content', 'uncanny_automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_meta,
			),
			array(
				'tokenId'         => 'POSTEXCERPT',
				'tokenName'       => __( 'Post excerpt', 'uncanny_automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_meta,
			),
			array(
				'tokenId'         => 'POSTIMAGEURL',
				'tokenName'       => __( 'Post featured image URL', 'uncanny-automator' ),
				'tokenType'       => 'url',
				'tokenIdentifier' => $trigger_meta,
			),
			array(
				'tokenId'         => 'POSTIMAGEID',
				'tokenName'       => __( 'Post featured image ID', 'uncanny_automator' ),
				'tokenType'       => 'text',
				'tokenIdentifier' => $trigger_meta,
			),
		);
		$tokens = array_merge( $tokens, $fields );
		return $tokens;
	}