WordPress.org

Ready to get started?Download WordPress

Codex

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

Function Reference/sanitize term field

Contents

Description

Cleanse the field value in the term based on the context.

Passing a term field value through the function should be assumed to have cleansed the value for whatever context the term field is going to be used.

If no context or an unsupported context is given, then default filters will be applied.

There are enough filters for each context to support a custom filtering without creating your own filter function. Simply create a function that hooks into the filter you need.

Usage

<?php sanitize_term_field$field$value$term_id$taxonomy$context ); ?>

Parameters

$field
(string) (required) Term field to sanitize
Default: None
$value
(string) (required) Search for this term value
Default: None
$term_id
(int) (required) Term ID
Default: None
$taxonomy
(string) (required) Taxonomy Name
Default: None
$context
(string) (required) Either edit, db, display, attribute, or js.
Default: None

Return Values

(mixed) 
sanitized field

Change Log

Since: 2.3

Source File

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