WordPress.org

Make WordPress Core

Opened 14 months ago

Last modified 14 months ago

#45085 new enhancement

different args passed to "term_name" and "term_{$field}" filters

Reported by: pbiron Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Taxonomy Keywords:
Focuses: docs, administration Cc:
PR Number:

Description

In /wp-admin/edit-tags.php, for each row in the WP_Term_List_Table, both term_name and term_{$field} (with $field == 'name') get applied before the term's name is displayed in the table.

As far as I can tell, there is no way to hook into term_name without also hooking into term_{$field} (when $field == 'name').

When term_name is applied, the 2nd argument is a WP_Term object; when term_{$field} (when $field == 'name') is applied, the 2nd argument is an int (term_id).

Given that both of these filters have been around for many years, I don't think it would be a good idea to change either one of them so that their argument lists were the same. However, I think it would be a good idea to add some explanation of this conflict in the DocBlocks of both filters.

Of course, I could add comments to both entries in the Code Reference, but I think it would be much better if that explanation were in the DocBlocks.

Change History (1)

#1 @pbiron
14 months ago

  • Type changed from defect (bug) to enhancement
Note: See TracTickets for help on using tickets.