Uses
Uses | Description |
---|---|
wp-includes/taxonomy.php: sanitize_term() | Sanitize Term all fields. |
Sanitizes category data based on context.
(object|array) (Required) Category data.
(string) (Optional)
Default value: 'display'
(object|array) Same type as $category with sanitized data for safe use.
File: wp-includes/category.php
function sanitize_category( $category, $context = 'display' ) { return sanitize_term( $category, 'category', $context ); }
Version | Description |
---|---|
2.3.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/sanitize_category