Automator_Recipe_Process_User::update_trigger( $user_id = null,  $trigger_id = null,  $recipe_id = null,  $ID = null )

Update the trigger for the user


Parameters Parameters

$user_id

(Optional) null

Default value: null

$trigger_id

(Optional) null

Default value: null

$recipe_id

(Optional) null

Default value: null

$ID

(Optional) null

Default value: null


Top ↑

Return Return

(null)


Source Source

File: src/core/lib/process/class-automator-recipe-process-user.php

	public function update_trigger( $user_id = null, $trigger_id = null, $recipe_id = null, $ID = null ) {

		// Set user ID
		if ( null === $user_id ) {
			$user_id = get_current_user_id();
		}

		// No user id is aviable.
		if ( 0 === $user_id ) {
			Automator()->error->add_error( 'update_trigger', 'ERROR: You are trying to update a trigger when a there is no logged in user.', $this );

			return null;
		}

		if ( null === $trigger_id || ! is_numeric( $trigger_id ) ) {
			Automator()->error->add_error( 'update_trigger', 'ERROR: You are trying to update a trigge without providing a trigger_id', $this );

			return null;
		}

		if ( null === $recipe_id || ! is_numeric( $recipe_id ) ) {
			Automator()->error->add_error( 'update_trigger', 'ERROR: You are trying to update a trigge without providing a recipe_id', $this );

			return null;
		}
	}