Opened 2 years ago
Last modified 7 days ago
#30829 new enhancement
I want to add the list table views in edit-tags.php
| Reported by: |
|
Owned by: | |
|---|---|---|---|
| Milestone: | Future Release | Priority: | normal |
| Severity: | normal | Version: | 4.1 |
| Component: | Taxonomy | Keywords: | good-first-bug has-patch |
| Focuses: | ui, administration, template | Cc: |
Description
I want to add some list table views in edit-tags.php page, but it is not possible without workout ,because in this page on line #326 run only this code <?php $wp_list_table->display(); ?> but I want to see
<?php $wp_list_table->views(); ?>;
<?php $wp_list_table->display(); ?>. In order to add some filters and render views.
Attachments (2)
Change History (9)
#1
@boonebgorges
2 years ago
This ticket was mentioned in Slack in #core by boone. View the logs.
14 months ago
#3
@boonebgorges
14 months ago
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to Future Release
Still seems like a good idea. Patch needed.
@eventualo
8 months ago
#4
@eventualo
8 months ago
- Keywords needs-patch removed
I've just added the 30829.patch. As suggested by @llemurya I added $wp_list_table->views() in edit-tags.php. So, like @boonebgorges remind us, it's possible to add table views using the views_edit-post_tag hook. I didn't add another filter inside get_views()/views() methods because there aren't similar filters in other posts/media edit files.
#5
@eventualo
8 months ago
- Keywords has-patch added
#6
@mariovalney
7 days ago
- Keywords needs-patch added; has-patch removed
@mariovalney
7 days ago
#7
@mariovalney
7 days ago
- Keywords has-patch added; needs-patch removed
I refreshed @eventualo patch and added get_views to WP_Terms_List_Table as suggested by @boonebgorges .
The only filter I found on get_views() was comment_status_links so without another filter to compare name I kept the term_view_links suggestion but added taxonomy to support custom ones:
term_' . $this->screen->taxonomy . '_view_links
I guess I'm not opposed to doing this, but as WP_Terms_List_Table is currently built, the only way you'll be able to add the views markup is by filtering 'views_edit-post_tag' and returning the link markup. IMO this is kind of a lousy UX. Better might be to introduce WP_Terms_List_Table::get_views(), which would return an empty array that'd pass through a 'term_view_links' filter or something like that. Then plugins could add their links in a more sensible way. Do you have thoughts about this?