sanitize_category( object|array $category, string $context = 'display' )
Sanitizes category data based on context.
Description Description
Parameters Parameters
- $category
-
(object|array) (Required) Category data
- $context
-
(string) (Optional) Default is 'display'.
Default value: 'display'
Return Return
(object|array) Same type as $category with sanitized data for safe use.
Source Source
File: wp-includes/category.php
function sanitize_category( $category, $context = 'display' ) { return sanitize_term( $category, 'category', $context ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |