A WordPress-centric search engine for devs and theme authors



sanitize_category ›

Since2.3.0
Deprecatedn/a
sanitize_category ( $category, $context = 'display' )
Parameters: (2)
  • (object|array) $category Category data
    Required: Yes
  • (string) $context Optional. Default is '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 );
}