Summery Summery

Sanitizes Term for editing.

Syntax Syntax

get_term_to_edit( int|object $id, string $taxonomy )

Description Description

Return value is sanitize_term() and usage is for sanitizing the term for editing. Function is for contextual and simplicity.

Parameters Parameters


(Required) Term ID or object.


(Required) Taxonomy name.

Return Return

(string|int|null|WP_Error) Will return empty string if $term is not an object.

Source Source

File: wp-includes/taxonomy.php

 * @see sanitize_term_field()
 * @param string      $field    Term field to fetch.
 * @param int|WP_Term $term     Term ID or object.
 * @param string      $taxonomy Optional. Taxonomy Name. Default empty.
 * @param string      $context  Optional. How to sanitize term fields. Look at sanitize_term_field() for available options.
 *                              Default 'display'.
 * @return string|int|null|WP_Error Will return an empty string if $term is not an object or if $field is not set in $term.
function get_term_field( $field, $term, $taxonomy = '', $context = 'display' ) {
	$term = get_term( $term, $taxonomy );
	if ( is_wp_error( $term ) ) {


Changelog Changelog

Version Description
2.3.0 Introduced.


Leave a Reply