Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825
Autonami_Helpers::extract_list_id_from_args( mixed $args )

extract_list_id_from_args


Warning: foreach() argument must be of type array|object, string given in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 830

Warning: Array to string conversion in /home/customer/www/docs.automatorplugin.com/public_html/wp-content/themes/wporg-developer/inc/template-tags.php on line 825

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;
	}