Automator_Recipe_Process_Complete::get_action_completed_status( null $user_id = null, null $action_data = null, null $recipe_id = null, string $error_message = '', null $recipe_log_id = null, array $args = array() )


Parameters Parameters

$user_id

(null) (Optional)

Default value: null

$action_data

(null) (Optional)

Default value: null

$recipe_id

(null) (Optional)

Default value: null

$error_message

(string) (Optional)

Default value: ''

$recipe_log_id

(null) (Optional)

Default value: null

$args

(array) (Optional)

Default value: array()


Top ↑

Return Return

(mixed|void)


Source Source

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

	public function get_action_completed_status( $user_id = null, $action_data = null, $recipe_id = null, $error_message = '', $recipe_log_id = null, $args = array() ) {

		/**
		 * @var $completed
		 * Meaning of each number
		 *
		 * 0 = not completed
		 * 1 = completed
		 * 2 = completed with errors, error message provided
		 * 5 = scheduled
		 * 9 = completed, do nothing
		 *
		 */
		$completed = 0;

		if ( is_array( $action_data ) && ! empty( $error_message ) && key_exists( 'complete_with_errors', $action_data ) ) {
			$completed = 2;
		} else if ( ( is_array( $action_data ) && key_exists( 'do-nothing', $action_data ) ) ) {
			$completed = 9;
		} else if ( empty( $error_message ) ) {
			$completed = 1;
		}

		return apply_filters( 'automator_get_action_completed_status', $completed, $user_id, $action_data, $recipe_id, $error_message, $recipe_log_id, $args );
	}