首页 WordPress函数大全 is_object_in_term()

is_object_in_term()

2020-05-02 / 5142阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

is_object_in_term( int $object_id, string $taxonomy, int|string|array $terms = null )

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

描述

The given terms are checked against the object’s terms’ term_ids, names and slugs. Terms given as integers will>

参数

$object_id

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

$taxonomy

(string)
(Required)
Single taxonomy name.

$terms

(int|string|array)
(Optional)
Term term_id, name, slug or array of said.

Default value: null

返回

(bool|WP_Error) WP_Error on input error.

大家谈论
    我的见解