WordPress at a glance
function is not described

sanitize_category_field() WP 2.3.0

Sanitizes data in single category key field.

No Hooks.


Mixed. Same type as $value after $value has been sanitized.


sanitize_category_field( $field, $value, $cat_id, $context );
$field(string) (required)
Category key to sanitize
$value(mixed) (required)
Category value to sanitize
$cat_id(int) (required)
Category ID
$context(string) (required)
What filter to use, 'raw', 'display', etc.

Code of sanitize category field: wp-includes/category.php WP 5.2.2

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