get_the_terms WordPress Filter Hook

The get_the_terms function is a powerful tool for retrieving information about the terms associated with a post. This function can be used to get the term objects for a post, or to get an array of term IDs for a post. It can also be used to get the term objects for a specific taxonomy.

apply_filters( 'get_the_terms', WP_Term[]|WP_Error $terms, int $post_id, string $taxonomy ) #

Filters the list of terms attached to the given post.


Parameters

$terms

(WP_Term[]|WP_Error)Array of attached terms, or WP_Error on failure.

$post_id

(int)Post ID.

$taxonomy

(string)Name of the taxonomy.


Top ↑

Source

File: wp-includes/category-template.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
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.