Taxonomy function to filter $tree by parent and depth
robertDouglass - November 11, 2005 - 16:18
| Project: | Drupal |
| Version: | 7.x-dev |
| Component: | taxonomy.module |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
Sometimes you have a taxonomy tree and you'd like to get all of the terms at a certain depth, or all the terms at a certain depth belonging to a certain parent. These are a set of filter functions to do that. (it's not a patch since these functions just need to be added to taxonomy.module, and I didn't know where in the module they would look the best)
| Attachment | Size | Status | Test result | Operations |
|---|---|---|---|---|
| taxonomy.module.txt | 1.42 KB | Ignored | None | None |

#1
getting rid of tabs (stupid IDE)
#2
One question I have about this code is whether the following function is necessary, or if there is a PHP native way to get rid of null array values?
<?php/**
* Utility function used by taxonomy_filter_tree
*/
function taxonomy_filter_not_null($term) {
return !is_null($term);
}
?>
#3
- Not critical.
- Who else wants this feature?
- Not a patchfile.
- That function can be abbreviated away with create_function.
#4
Don't know how it got set critical... it most certainly isn't.
What do you mean abbreviated away?
I didn't submit a patch file since I wanted the maintainer to have the discretion of where to put the extra functions. At the end of the taxonomy.module file?
#5
create_function ... ok, got it.
#6
create_function ... ok, got it.
I guess this a fixed issue.
#7
Automatically closed -- issue fixed for two weeks with no activity.
#8
Hi,
I thinks It could be very interesting to have that...
I will test this function
Thanks for all ;)
Bye