首页 WordPress函数大全 sanitize_term()

sanitize_term()

2020-05-02 / 2973阅 / 悠然

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

sanitize_term( array|object $term, string $taxonomy, string $context = 'display' )

消毒术语所有字段。

描述

依靠> sanitize_term_field()清理术语。不同之处在于此功能将清除所有字段。上下文基于> sanitize_term_field()。

$ term应该是数组或对象。

参数

$term

(array|object)
(Required)
The term to check.

$taxonomy

(string)
(Required)
The taxonomy name to use.

$context

(string)
(Optional)
Context in which to sanitize the term. Accepts 'edit', 'db', 'display', 'attribute', or 'js'.

Default value: 'display'

返回

(array|object) Term with all fields sanitized.

大家谈论
    我的见解