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



wp_get_term_taxonomy_parent_id › WordPress Function

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) Parent term ID on success, false on failure.
定义在:
文档:

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