Others have asked how to only get parent terms, but I need to get the deepest term for the post of a specific taxonomy.
Is there a way I can only get terms where the number of children = 0?
|
Others have asked how to only get parent terms, but I need to get the deepest term for the post of a specific taxonomy. Is there a way I can only get terms where the number of children = 0? |
|||
|
|
|
I have written this function some time ago, it may be a bit sloppy but it does it's job:
|
|||
|
|