Summery Summery

Sanitize Term all fields.

Syntax Syntax

sanitize_term( array|object $term, string $taxonomy, string $context = 'display' )

Description Description

Relies 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.

Parameters Parameters


(array|object) (Required) The term to check.


(string) (Required) The taxonomy name to use.


(string) (Optional) Context in which to sanitize the term. Accepts 'edit', 'db', 'display', 'attribute', or 'js'.

Default value: 'display'

Return Return

(array|object) Term with all fields sanitized.

Source Source

File: wp-includes/taxonomy.php



Changelog Changelog

Version Description
2.3.0 Introduced.


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.