WordPress开发者和主题制作者的搜索引擎



sanitize_category ›

Since2.3.0
已弃用n/a
sanitize_category ( $category, $context = 'display' )
参数: (2)
  • (object|array) $category Category data
    Required: Yes
  • (string) $context Optional. Default is 'display'.
    Required: No
    默认: 'display'
返回:
  • (object|array) Same type as $category with sanitized data for safe use.
定义在:
文档:

Sanitizes category data based on context.



源码

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