WordPress.org

Codex

Interested in functions, hooks, classes, or methods? Check out the new WordPress Code Reference!

Function Reference/sanitize term

Description

Sanitize Term all fields.

Relys on sanitize_term_field() to sanitize the term. The difference is that this function will sanitize all fields. The context is based on sanitize_term_field().

The $term is expected to be either an array or an object.

Usage

<?php sanitize_term$term$taxonomy$context ?>

Parameters

$term
(array|object) (required) The term to check.
Default: None
$taxonomy
(string) (required) The taxonomy name to use.
Default: None
$context
(string) (optional) Default is 'display'.
Default: 'display'

Return Values

(array|object) 
Term with all fields sanitized

Examples

Notes

Change Log

Since: 2.3.0

Source File

sanitize_term() is located in wp-includes/taxonomy.php.

Related

See also index of Function Reference and index of Template Tags.