term_is_ancestor_of

Advertisement

Summery Summery

Check if a term is an ancestor of another term.

Syntax Syntax

term_is_ancestor_of( int|object $term1, int|object $term2, string $taxonomy )

Description Description

You can use either an id or the term object for both parameters.

Parameters Parameters

$term1

(int|object) (Required) ID or object to check if this is the parent term.

$term2

(int|object) (Required) The child term.

$taxonomy

(string) (Required) Taxonomy name that $term1 and $term2 belong to.

Return Return

(bool) Whether $term2 is a child of $term1.

Source Source

File: wp-includes/taxonomy.php


			

Advertisement

Changelog Changelog

Changelog
Version Description
3.4.0 Introduced.

Advertisement

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.