Ticket #6122 (new enhancement)

Opened 9 months ago

Last modified 8 months ago

Add taxonomy_id_filter like term_id_filter

Reported by: chmac Assigned to: anonymous
Priority: normal Milestone: 2.9
Component: General Version:
Severity: normal Keywords: 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

add_taxonomy_id_filter.patch (0.7 kB) - added by chmac on 05/27/08 07:25:50.
Updated patch with the new line nos as at r1206
add_taxonomy_id_filter_option2.patch (6 bytes) - added by chmac on 05/27/08 07:26:47.
This option would not work, uploading blank patch to delete the file.
add_taxonomy_id_filter_option3.patch (6 bytes) - added by chmac on 05/27/08 07:27:13.
This option would not work, uploading blank patch to delete the file.

Change History

03/07/08 11:00:41 changed by chmac

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.

03/07/08 11:03:48 changed by chmac

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.

03/19/08 10:13:41 changed by chmac

Ignore option 3, $tt_id must be passed as the first argument for the filter to return correctly if no filter is specified.

03/19/08 11:49:46 changed by ffemtcj

  • milestone changed from 2.5 to 2.6.

03/24/08 14:33:46 changed by chmac

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

05/27/08 07:25:50 changed by chmac

  • attachment add_taxonomy_id_filter.patch added.

Updated patch with the new line nos as at r1206

05/27/08 07:26:47 changed by chmac

  • attachment add_taxonomy_id_filter_option2.patch added.

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

05/27/08 07:27:13 changed by chmac

  • attachment add_taxonomy_id_filter_option3.patch added.

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