WPDev.one
Core Function
View Source on Trac ↗

is_object_in_term()

is_object_in_term( mixed $object_id, mixed $taxonomy, mixed $terms = null )

Determines if the given object is associated with any of the given terms.

Parameters 3 required

Name / Type Description
$object_id
int

ID of the object (post ID, link ID, ...).

Required
$taxonomy
string

Single taxonomy name.

Required
mixed

(int | string | int[] | string[]) $terms Optional. Term ID, name, slug, or array of such to check against. Default null.

Required

Return Value

((bool)
| WP_Error) WP_Error on input error.

Function Information

Since Version
2.7.0
Source File
wp-includes/taxonomy.php
Advertisement