get_term_to_edit( int|object $id, string $taxonomy )
Sanitizes Term for editing.
Description Description
Return value is sanitize_term() and usage is for sanitizing the term for editing. Function is for contextual and simplicity.
Parameters Parameters
- $id
-
(int|object) (Required) Term ID or object.
- $taxonomy
-
(string) (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
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' ); }
Expand full source code Collapse full source code View on Trac
Changelog Changelog
Version | Description |
---|---|
2.3.0 | Introduced. |