Tribe__Validator__Base::is_positive_int_list( array|string|int $list, string $sep = ',' )

Whether the value is a list of positive integers only or not.


Parameters

$list

(array|string|int) (Required)

$sep

(string) (Optional)

Default value: ','


Top ↑

Return

(bool)


Top ↑

Source

File: src/Tribe/Validator/Base.php

	public function is_positive_int_list( $list, $sep = ',' ) {
		$sep  = is_string( $sep ) ? $sep : ',';
		$list = Tribe__Utils__Array::list_to_array( $list, $sep );

		$valid = array_filter( $list, array( $this, 'is_positive_int' ) );

		return ! empty( $valid ) && count( $valid ) === count( $list );
	}

Top ↑

Changelog

Changelog
Version Description
4.7.19 Introduced.