tribe_get_event_cat_ids( int|string|WP_Post $post_id )
Returns an array terms term_id from the taxonomy tribe_cat for a given event.
Contents
Parameters
- $post_id
-
(int|string|WP_Post) (Required)
Return
(array<int>)
Source
File: src/functions/template-tags/general.php
function tribe_get_event_cat_ids( $post_id = 0 ) {
$post_id = Tribe__Events__Main::postIdHelper( $post_id );
return wp_list_pluck( (array) get_the_terms( $post_id, Tribe__Events__Main::TAXONOMY ), 'term_id' );
}
Changelog
| Version | Description |
|---|---|
| 6.0.11 | Type hinting the return to array. |
| 3.0.0 | Introduced. |