sanitize_category() - WordPress 函数参考中文文档

返回介绍

sanitize_category()

发布于 2017-09-11 字数1219 浏览 950 评论 0

sanitize_category( object|array $category,  string $context = 'display' )

Sanitizes category data based on context.


描述


参数

$category

(object|array)
(Required)
Category data

$context

(string)
(Optional)
Default is ‘display’.

Default value: ‘display’


返回值

(object|array) Same type as $category with sanitized data for safe use.


源代码

File: wp-includes/category.php

function sanitize_category( $category, $context = 'display' ) {
	return sanitize_term( $category, 'category', $context );
}

更新日志

Version 描述
2.3.0 Introduced.

相关函数

Uses

  • wp-includes/taxonomy.php:
    sanitize_term()

User Contributed Notes

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

目前还没有任何评论,快来抢沙发吧!