Tokens::parse_from_trigger_meta( $meta,  $token, false $readable = false )


Parameters Parameters

$meta

(Required)

$token

(Required)

$readable

(false) (Optional)

Default value: false


Top ↑

Return Return

(mixed|void)


Source Source

File: src/core/lib/recipe-parts/trait-tokens.php

	public static function parse_from_trigger_meta( $meta, $token, $readable = false ) {
		/**
		 * @var mixed $value
		 * @var array $pieces
		 * @var int $recip_id
		 * @var array $trigger_data
		 * @var int $user_id
		 * @var array $replace_args
		 */
		extract( $token ); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract

		if ( ! self::is_valid( $meta, $token ) ) {
			return apply_filters( 'automator_parse_from_trigger_meta', $value, $meta, $token, $readable );
		}

		$value = $trigger_data[0]['meta'];

		if ( true === $readable && isset( $trigger_meta[ $meta . '_readable' ] ) && ! empty( $trigger_meta[ $meta . '_readable' ] ) ) {
			$value = $trigger_meta[ $meta . '_readable' ];
		}

		return apply_filters( 'automator_parse_from_trigger_meta', $value, $meta, $token, $readable );
	}