Opened 5 years ago

Last modified 3 years ago

#6122 new enhancement

Add taxonomy_id_filter like term_id_filter

Reported by: chmac Owned by: ryan
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 (3)

add_taxonomy_id_filter.patch (710 bytes) - added by chmac 5 years ago.
Updated patch with the new line nos as at r1206
add_taxonomy_id_filter_option2.patch (6 bytes) - added by chmac 5 years ago.
This option would not work, uploading blank patch to delete the file.
add_taxonomy_id_filter_option3.patch (6 bytes) - added by chmac 5 years ago.
This option would not work, uploading blank patch to delete the file.

Download all attachments as: .zip

Change History (12)

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.

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.

  • Milestone changed from 2.5 to 2.6

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. :)

chmac5 years ago

Updated patch with the new line nos as at r1206

chmac5 years ago

This option would not work, uploading blank patch to delete the file.

chmac5 years ago

This option would not work, uploading blank patch to delete the file.

  • Component changed from General to Taxonomy
  • Owner changed from anonymous to ryan
  • Keywords has-patch added

patch still applies clean

  • Keywords needs-review added

comment:9   ryan3 years ago

  • Milestone changed from 2.9 to Future Release
Note: See TracTickets for help on using tickets.