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.


Top ↑

Source

File: wp-includes/category-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
4.4.0Added $post_id parameter.
3.1.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.