Switch language

wpseek.com
A WordPress-centric search engine for devs and theme authors




cat_is_ancestor_of [ WordPress Function ]

cat_is_ancestor_of ( $cat1, $cat2 )
Parameters:
  • (int|object) $cat1 ID or object to check if this is the parent category.
  • (int|object) $cat2 The child category.
Returns:
  • (bool) Whether $cat2 is child of $cat1
Defined at:



Check if a category is an ancestor of another category.

You can use either an id or the category object for both parameters. If you use an integer the category will be retrieved.

Source


<?php
function cat_is_ancestor_of$cat1$cat2 ) {
    return 
term_is_ancestor_of$cat1$cat2'category' );
}
?>

Examples [ wp-snippets.com ]

Top Google zoekresultaten

Meer ...

0 User Note(s)

Nog geen één. Wees de eerste!

Nieuw toevoegen ...



HTML5 Powered with CSS3 / Styling, Performance & Integration, and Semantics