Function: sanitize_category

sanitize_category( object | array $category, string $context )

Sanitizes category data based on context.

Shortcut: sc

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
$category object | array

Category data

$context string 'display'

Optional. Default is 'display'.


object | array

Same type as $category with sanitized data for safe use.

WordPress Developer Newsletter

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