Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: get_the_categories

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
88      /**
89       * Filters the array of categories to return for a post.
90       *
91       * @since 3.1.0
92       * @since 4.4.0 Added `$id` parameter.
93       *
94       * @param WP_Term[] $categories An array of categories to return for the post.
95       * @param int|false $id         ID of the post.
96       */
97      return apply_filters( 'get_the_categories', $categories, $id );
98 }
99
100 /**
101  * Retrieve category name based on category ID.
102  *
103  * @since 0.71
104  *
105  * @param int $cat_ID Category ID.
106  * @return string|WP_Error Category name on success, WP_Error on failure.