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)

Comments

robertdouglass’s picture

StatusFileSize
new1.43 KB

getting rid of tabs (stupid IDE)

robertdouglass’s picture

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?


/**
 * Utility function used by taxonomy_filter_tree
 */
function taxonomy_filter_not_null($term) {
  return !is_null($term);
}

drumm’s picture

Priority: Critical » Normal
Status: Needs review » Needs work

- Not critical.
- Who else wants this feature?
- Not a patchfile.
- That function can be abbreviated away with create_function.

robertdouglass’s picture

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?

robertdouglass’s picture

create_function ... ok, got it.

LAsan’s picture

Version: x.y.z » 7.x-dev
Status: Needs work » Fixed

create_function ... ok, got it.

I guess this a fixed issue.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

pydubreucq’s picture

Hi,
I thinks It could be very interesting to have that...
I will test this function
Thanks for all ;)
Bye