WPDev.one
Core Function
View Source on Trac ↗

sanitize_term()

sanitize_term( mixed $term, mixed $taxonomy, mixed $context = 'display' )

Sanitizes all term fields.

Parameters 3 required

Name / Type Description
(array

| object) $term The term to check.

Required
$taxonomy
string

The taxonomy name to use.

Required
string

$context Optional. Context in which to sanitize the term. Accepts 'raw', 'edit', 'db', 'display', 'rss', 'attribute', or 'js'. Default 'display'.

Required

Return Value

((array)
| object) Term with all fields sanitized.

Function Information

Since Version
2.3.0
Source File
wp-includes/taxonomy.php
Advertisement