Sanitizes category data based on context.
Parameters
$category
object|arrayrequired- Category data.
$context
stringoptional- Default
'display'
.Default:
'display'
Source
function sanitize_category( $category, $context = 'display' ) {
return sanitize_term( $category, 'category', $context );
}
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.