首页 WordPress函数大全 is_tax()

is_tax()

2020-05-02 / 2265阅 / 悠然

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

is_tax( string|string[] $taxonomy = '', int|string|int[]|string[] $term = '' )

Determines whether the query is for an existing custom taxonomy archive page.

描述

If the $taxonomy parameter is specified, this function will additionally check if the query is for that specific $taxonomy.

If the $term parameter is specified in addition to the $taxonomy parameter, this function will additionally check if the query is for> Conditional Tags article in the Theme Developer Handbook.

参数

$taxonomy

(string|string[])
(Optional)
Taxonomy slug or slugs to check against.

Default value: ''

$term

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

Default value: ''

返回

(bool) True for custom taxonomy archive pages, false for built-in taxonomies (category and tag archives).

大家谈论
    我的见解