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

Sanitizes category data based on context.


Parameters

$category

(Required) Category data

$context

(Optional) Default is 'display'.

Default value: 'display'


Return

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


Source

File: wp-includes/category.php

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


Changelog

Changelog
Version Description
WP-2.3.0 Introduced.