Automator_Input_Parser::v3_parser( $return,  $replace_args, array $args = array() )


Parameters Parameters

$return

(Required)

$replace_args

(Required)

$args

(array) (Optional)

Default value: array()


Top ↑

Return Return

(false|mixed)


Source Source

File: src/core/lib/utilities/class-automator-input-parser.php

	public function v3_parser( $return, $replace_args, $args = array() ) {
		$pieces     = $replace_args['pieces'];
		$recipe_id  = $replace_args['recipe_id'];
		$trigger_id = absint( $pieces[0] );
		$trigger    = Automator()->get_trigger_data( $recipe_id, $trigger_id );
		if ( empty( $trigger ) ) {
			return $return;
		}
		$trigger_code = $trigger['meta']['code'];
		$token_parser = Automator()->get->value_from_trigger_meta( $trigger['meta']['code'], 'token_parser' );

		if ( ! empty( $token_parser ) ) {
			$token_args = array(
				'trigger_code' => $trigger_code,
				'replace_args' => $replace_args,
				'args'         => $args,
			);

			return call_user_func( $token_parser, $return, $token_args );
		}

		return $return;
	}