Ticket #6122 (new enhancement)
Add taxonomy_id_filter like term_id_filter
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Priority: | normal | Milestone: | Future Release |
| Component: | Taxonomy | Version: | |
| Severity: | normal | Keywords: | has-patch needs-review term_id_filter, taxonomy_id_filter, wp_terms, wp_taxonomy |
| Cc: |
Description
Currently the $term_id is filtered in taxonomy.php but not the taxonomy_id (tt_id). These filters are used in WordPress Multi-User.
Currently WPMU globalises the wp_terms table. I am extending this to the wp_taxonomy table also, for which I need these two new filters.
Attachments
Change History
I've noticed that all the actions and filters seem to be passed the term_id as the first argument and the taxonomy_id as the second argument. So in keeping with that, I've attached a third patch with the filters taking the arguments in this order.
Ignore option 3, $tt_id must be passed as the first argument for the filter to return correctly if no filter is specified.
Having given this some considerable thought over the last couple of weeks, I think option 1 is the best. If you change the ID of a term_taxonomy you need to invalidate the relevant cache. That involves invalidating the cache of the term and taxonomy, so any filters would most likely need both values to be passed.
Unfortunately I can't delete files on trac, so no way to remove options 2 and 3. Hopefully option 1 will make it into 2.6. :)
-
attachment
add_taxonomy_id_filter.patch
added
Updated patch with the new line nos as at r1206
-
attachment
add_taxonomy_id_filter_option2.patch
added
This option would not work, uploading blank patch to delete the file.
-
attachment
add_taxonomy_id_filter_option3.patch
added
This option would not work, uploading blank patch to delete the file.
- Owner changed from anonymous to ryan
- Component changed from General to Taxonomy

Optionally, the filters only need to be passed the id being filtered and not the corresponding ID.
For example, the term_id_filter only needs the term_id and not the taxonomy_id. Likewise the taxonomy_id_filter does not need the term_id.
I've attached a second patch including this change as well.