Function: sanitize_category_field

sanitize_category_field( string $field, mixed $value, integer $cat_id, string $context )

Sanitizes data in single category key field.

Shortcut: scf

You can use above key combination to trigger the associated snippet for this function in the WordPress Snippets for Visual Studio Code extension. You can also use this shortcut to search for this function on this website.


Name Type(s) Default Value Description
$field string

Category key to sanitize

$value mixed

Category value to sanitize

$cat_id integer

Category ID

$context string

What filter to use, 'raw', 'display', etc.



Same type as $value after $value has been sanitized.

WordPress Developer Newsletter

Stay informed of new chapter releases, important WordPress API updates and more.