Automator_Functions::get_trigger_data( int $recipe_id, int $trigger_id )

Added this function to directly fetch trigger data instead of looping thru recipe and it’s triggers for parsing. Specially needed for multi-trigger parsing


Parameters Parameters

$recipe_id

(int) (Required)

$trigger_id

(int) (Required)


Top ↑

Return Return

(array|mixed)


Source Source

File: src/core/lib/class-automator-functions.php

	public function get_trigger_data( $recipe_id = 0, $trigger_id = 0 ) {
		$recipe_data = $this->get_recipe_data( 'uo-trigger', $recipe_id );
		if ( ! $recipe_data ) {
			return array();
		}
		foreach ( $recipe_data as $trigger_data ) {
			if ( absint( $trigger_id ) !== absint( $trigger_data['ID'] ) ) {
				continue;
			}

			return $trigger_data;
		}

		return array();
	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.9 Introduced.