On this page
sanitize_category_field( string $field, mixed $value, int $cat_id, string $context ): mixed
Sanitizes data in single category key field.
Parameters
$fieldstring Required-
Category key to sanitize.
$valuemixed Required-
Category value to sanitize.
$cat_idint Required-
Category ID.
$contextstring Required-
What filter to use,
'raw','display', etc.
Return
mixed Value after $value has been sanitized.
Source
File: wp-includes/category.php. View all references
function sanitize_category_field( $field, $value, $cat_id, $context ) {
return sanitize_term_field( $field, $value, $cat_id, 'category', $context );
}
Related
Uses
| Uses | Description |
|---|---|
| sanitize_term_field() wp-includes/taxonomy.php | Sanitizes the field value in the term based on the context. |
Changelog
| Version | Description |
|---|---|
| 2.3.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/sanitize_category_field