Automator_Get_Data::trigger_accepted_args_from_trigger_code( null $trigger_code = null )

Accepts a trigger code(most like from trigger meta) and returns that associated trigger validation function accepted args


Parameters Parameters

$trigger_code

(null) (Optional)

Default value: null


Top ↑

Return Return

(null) |int Default arguments is always 1


Source Source

File: src/core/lib/utilities/class-automator-get-data.php

	public function trigger_accepted_args_from_trigger_code( $trigger_code = null ) {

		if ( null === $trigger_code || ! is_string( $trigger_code ) ) {
			Automator()->error->add_error( 'trigger_accepted_args_from_trigger_code', 'ERROR: You are trying to get a trigger validation function accepted args from a trigger code without providing a $trigger_code', $this );

			return null;
		}
		$trigger_accepted_args = 1;
		// Load all default trigger settings
		$system_triggers = Automator()->get_triggers();
		if ( empty( $system_triggers ) ) {
			return $trigger_accepted_args;
		}
		foreach ( $system_triggers as $system_trigger ) {

			if ( $system_trigger['code'] === $trigger_code ) {
				return $system_trigger['accepted_args'];
			}
		}

		return $trigger_accepted_args;
	}