Tribe__Events__API::get_event_terms( int $event_id, array $args = array() )
Contents
See also
Parameters
- $event_id
-
(int) (Required) The event post ID
- $args
-
(array) (Optional) An array of arguments supported by the
wp_get_object_termsfunction.Default value: array()
Return
(array) An associative array of terms in the [ <taxonomy> => [ <term_1>, <term_2>, ...], ...] format.
Source
File: src/Tribe/API.php
public static function get_event_terms( $event_id, array $args = array() ) {
$terms = array();
foreach ( get_post_taxonomies( $event_id ) as $taxonomy ) {
$tax_terms = wp_get_object_terms( $event_id, $taxonomy, $args );
$terms[ $taxonomy ] = $tax_terms;
}
return $terms;
}
Changelog
| Version | Description |
|---|---|
| 4.5 | Introduced. |