wpseek.com
A WordPress-centric search engine for devs and theme authors



sanitize_category › WordPress Function

Since2.3.0
Deprecatedn/a
sanitize_category ( $category, $context = 'display' )
Parameters: (2)
  • (object|array) $category Category data.
    Required: Yes
  • (string) $context Optional. Default 'display'.
    Required: No
    Default: 'display'
Returns:
  • (object|array) Same type as $category with sanitized data for safe use.
Defined at:
Codex:

Sanitizes category data based on context.



Source

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