Uses
Uses | Description |
---|---|
wp-includes/taxonomy.php: get_term() | Get all Term data from database by Term ID. |
wp-includes/load.php: is_wp_error() | Check whether variable is a WordPress Error. |
Returns the term’s parent’s term_ID.
(int) (Required) Term ID.
(string) (Required) Taxonomy name.
(int|false) False on error.
File: wp-includes/taxonomy.php
function wp_get_term_taxonomy_parent_id( $term_id, $taxonomy ) { $term = get_term( $term_id, $taxonomy ); if ( ! $term || is_wp_error( $term ) ) { return false; } return (int) $term->parent; }
Version | Description |
---|---|
3.1.0 | Introduced. |
© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_get_term_taxonomy_parent_id