Savoir si une custom taxonomy a un parent ou non

event 30 Sep 2016 account_circle Julien
label_outline PHP WordPress

[pastacode lang= »php » manual= »%3C%3Fphp%20%0A%09if%20(term_is_ancestor_of(%20%24term-%3Eparent%2C%20%24term%2C%20’catalogues’%20))%20%3A%0A%09%09echo%20%22j’ai%20un%20parent%2C%20youhou%20!%22%3B%0A%09else%20%3A%0A%09%09echo%20%22je%20suis%20orphelin%20%3A-(%22%3B%0A%09endif%3B%0A%3F%3E » message= » » highlight= » » provider= »manual »/]