Autonami_Helpers::extract_list_id_from_args( mixed $args )

extract_list_id_from_args


Parameters Parameters

$args

(Required)


Top ↑

Return Return

(void)


Source Source

File: src/integrations/autonami/helpers/autonami-helpers.php

	public function extract_list_id_from_args( $args ) {

		if ( ! is_array( $args ) ) {
			throw new \Exception( __( 'List not found', 'uncanny-automator' ) );
		}

		$list = array_shift( $args );

		if ( empty( $list ) ) {
			throw new \Exception( __( 'List not found', 'uncanny-automator' ) );
		}

		if ( ! is_numeric( $list ) ) {
			return $list->get_id();
		}

		return $list;
	}