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



sanitize_category_field ›

Since2.3.0
已弃用n/a
sanitize_category_field ( $field, $value, $cat_id, $context )
参数: (4)
  • (string) $field Category key to sanitize
    Required: Yes
  • (mixed) $value Category value to sanitize
    Required: Yes
  • (int) $cat_id Category ID
    Required: Yes
  • (string) $context What filter to use, 'raw', 'display', etc.
    Required: Yes
返回:
  • (mixed) Same type as $value after $value has been sanitized.
定义在:
文档:

Sanitizes data in single category key field.



源码

function sanitize_category_field( $field, $value, $cat_id, $context ) {
	return sanitize_term_field( $field, $value, $cat_id, 'category', $context );
}