WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 19 months ago

#6122 closed enhancement (wontfix)

Add taxonomy_id_filter like term_id_filter

Reported by: chmac Owned by: ryan
Milestone: Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords:
Focuses: 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 7 years ago.
Updated patch with the new line nos as at r1206
add_taxonomy_id_filter_option2.patch (6 bytes) - added by chmac 7 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 7 years ago.
This option would not work, uploading blank patch to delete the file.

Download all attachments as: .zip

Change History (13)

comment:1 @chmac7 years ago

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.

comment:2 @chmac7 years ago

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.

comment:3 @chmac7 years ago

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

comment:4 @ffemtcj7 years ago

  • Milestone changed from 2.5 to 2.6

comment:5 @chmac7 years ago

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

@chmac7 years ago

Updated patch with the new line nos as at r1206

@chmac7 years ago

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

@chmac7 years ago

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

comment:6 @Denis-de-Bernardy6 years ago

  • Component changed from General to Taxonomy
  • Owner changed from anonymous to ryan

comment:7 @Denis-de-Bernardy6 years ago

  • Keywords has-patch added

patch still applies clean

comment:8 @Denis-de-Bernardy6 years ago

  • Keywords needs-review added

comment:9 @ryan5 years ago

  • Milestone changed from 2.9 to Future Release

comment:10 @wonderboymusic19 months ago

  • Keywords has-patch needs-review term_id_filter taxonomy_id_filter wp_terms wp_taxonomy removed
  • Milestone Future Release deleted
  • Resolution set to wontfix
  • Status changed from new to closed

This guy tried to delete his patch, no activity in 4 years, sounds dangerous anyway

Note: See TracTickets for help on using tickets.