get_the_categories WordPress Filter Hook
The get_the_categories hook is used to retrieve the list of categories for a post. This hook is called in the the_category() template tag.
apply_filters( 'get_the_categories', WP_Term[] $categories , int|false $post_id ) #
Filters the array of categories to return for a post.
Parameters
- $categories
(WP_Term[])An array of categories to return for the post.
- $post_id
(int|false)ID of the post.
Source
Changelog
Version | Description |
---|---|
4.4.0 | Added $post_id parameter. |
3.1.0 | Introduced. |