Changes between Initial Version and Version 1 of Ticket #29839, comment 12
- Timestamp:
- 11/12/2014 08:36:00 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #29839, comment 12
initial v1 3 3 `_get_term_hierarchy` returns an array of arrays, and each of these sub-arrays is a termID-indexed list of that terms children; said another way, each sub-array contains the children of a given term. Crucially it does not list terms ''without'' children, so this can be used as the test for finding which terms are leaf terms: any term that does not have its own array has no children and is by definition a leaf term. 4 4 5 So all we need to do is get a list of all terms, and any term that does not have an array in the results of `_get_term_hierarchy` is a leaf term. This is what I've done with the attached patch. Thoughts? 5 So all we need to do is get a list of all terms, and any term that does not have an array in the results of `_get_term_hierarchy` is a leaf term. This is what I've done with the attached patch. 6 7 I've also made it fail if the taxonomy is not hierarchical as a non-hierarchical taxonomy would return all terms in this case. 8 9 Thoughts?