WordPress开发者和主题制作者的搜索引擎



wp_get_term_taxonomy_parent_id ›

Since3.1.0
已弃用n/a
wp_get_term_taxonomy_parent_id ( $term_id, $taxonomy )
参数: (2)
  • (int) $term_id Term ID.
    Required: Yes
  • (string) $taxonomy Taxonomy name.
    Required: Yes
返回:
  • (int|false) False on error.
定义在:
文档:

Returns the term's parent's term_ID.



源码

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;
}