WordPress at Your Fingertips
function is not described

sanitize_category() WP 2.3.0

Sanitizes category data based on context.

No Hooks.

Return

Object|Array. Same type as $category with sanitized data for safe use.

Usage

sanitize_category( $category, $context );
$category(object|array) (required)
Category data.
$context(string)
Optional.
Default: 'display'

Changelog

Since 2.3.0 Introduced.

Code of sanitize_category() WP 5.8

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