W3cubDocs

/WordPress

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

$termsWP_Term[]|WP_Error
Array of attached terms, or WP_Error on failure.
$post_idint
Post ID.
$taxonomystring
Name of the taxonomy.

Source

$terms = apply_filters( 'get_the_terms', $terms, $post->ID, $taxonomy );

Changelog

Version Description
3.1.0 Introduced.

© 2003–2024 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/get_the_terms