Sanitizes term for editing.
Description
Return value is sanitize_term() and usage is for sanitizing the term for editing. Function is for contextual and simplicity.
Parameters
$id
int|objectrequired- Term ID or object.
$taxonomy
stringrequired- Taxonomy name.
Source
function get_term_to_edit( $id, $taxonomy ) {
$term = get_term( $id, $taxonomy );
if ( is_wp_error( $term ) ) {
return $term;
}
if ( ! is_object( $term ) ) {
return '';
}
return sanitize_term( $term, $taxonomy, 'edit' );
}
Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.