Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Gamipress_Tokens::parse_token( $value,  $pieces,  $recipe_id,  $trigger_data,  $user_id,  $replace_args )

Parse the token as usual.

Contents


Return Return

(string) the value of the token.


Source Source

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

	public function parse_token( $value, $pieces, $recipe_id, $trigger_data, $user_id, $replace_args ) {
		$award_type = $trigger_data[0]['meta']['GPAWARDTYPES'] ?? '';
		$token = $pieces[2] ?? '';
		if ( ! empty( $token ) && ! empty( $award_type ) ) {
			if ( 'GPAWARDTYPES' === $token ) {
				$award_type = $trigger_data[0]['meta']['GPAWARDTYPES_readable'] ?? '';
				return $award_type;
			}
		}
		return $value;
	}