WP_Posts_List_Table::extra_tablenav() applies restrict_manage_posts, which can be used by a plugin to output extra dropdowns (or other markup) that allow filtering the posts in the table by arbitrary criteria.
Similarly, WP_(Users|Comments)_List_Table
have a resttric_manage_(users|comment)
action for similar purposes.
However, as far as I can tell, WP_Terms_List_Table does not. Is this correct?
I'm writing a plugin that relies heavily on termmeta
on various custom taxonomies. My plugin adds custom columns to edit-tags.php?taxonomy=my_custom_tax
that display the value(s) of the various termmeta
for each term. It would greatly enhance the UX of my plugin if users were able to filter the term list by the distinct meta_value
's for my meta_key
's.
Before I open a Trac ticket that proposes adding a WP_Terms_List_Table::extra_tablenav()
method and restrict_manage_terms
filter so that it would be possible to do what I want to do, I wanted to see if anyone here on WPSE knows:
- is there a viable work around (that doesn't involve something like hijacking
edit-tags.php?taxonomy=my_custom_tax
to redirect to a custom page that uses a custom subclass ofWP_Terms_List_Table
)? - is there a (good) reason
WP_Terms_List_Table
doesn't currently support this functionality?- I realize for core there is no (good) reason to filter by any of the standard
WP_Term_List_Table
columns, but adding custom columns to it is fairly common and I can't believe I'm the only one who's ever wanted to filter by the values in custom columns.
- I realize for core there is no (good) reason to filter by any of the standard
Edit
I should note that I when displaying the meta_value
in the custom column, I am outputting it as a link which effectively filters the term list by that value. The the reason the UX would be enchanced if users could choose from a dropdown (like in WP_Posts_List_Table
) is that not all values of the meta_value
are always visible on any given page of terms displayed in the list table. What I do to use the links to filter by a value that is not currently displayed on the current page is click on a random link, then edit the resulting URL in the browser's address field to have the meta_value
I want to filter by. Not only is that a pain, but not all user's are savy enough to realize they can do this.