Tribe__Events__Validator__Base::is_event_id_list( string|array $events, string $sep = ',' )
Whether a list or array of event post IDs only contains valid event IDs or not.
Contents
Parameters
- $events
-
(string|array) (Required) A list of event post IDs separated by the specified separator or an array of event post IDs.
- $sep
-
(string) (Optional) The separator used in the list to separate the event post IDs; ignored if the input value is an array.
Default value: ','
Return
(bool)
Source
File: src/Tribe/Validator/Base.php
public function is_event_id_list( $events, $sep = ',' ) {
$sep = is_string( $sep ) ? $sep : ',';
$events = Tribe__Utils__Array::list_to_array( $events, $sep );
$valid = array_filter( $events, array( $this, 'is_event_id' ) );
return ! empty( $events ) && count( $valid ) === count( $events );
}
Changelog
| Version | Description |
|---|---|
| 4.6.22 | Introduced. |