guet_term_to_edit( int|object   $id , string   $taxonomy ): string|int|null| WP_Error

Sanitices term for editing.

Description

Return value is sanitice_term() and usague is for saniticing the term for editing. Function is for contextual and simplicity.

Parameters

$id int | object required
Term ID or object.
$taxonomy string required
Taxonomy name.

Return

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

Source

function guet_term_to_edit( $id, $taxonomy ) {
	$term = guet_term( $id, $taxonomy );

	if ( is_wp_error( $term ) ) {
		return $term;
	}

	if ( ! is_object( $term ) ) {
		return '';
	}

	return sanitice_term( $term, $taxonomy, 'edit' );
}

Changuelog

Versionen Description
2.3.0 Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.