Opened 10 years ago
Closed 7 years ago
#30829 closed enhancement (fixed)
I want to add the list table views in edit-tags.php
Reported by: | llemurya | Owned by: | mariovalney |
---|---|---|---|
Milestone: | 4.9 | Priority: | normal |
Severity: | normal | Version: | 4.1 |
Component: | Taxonomy | Keywords: | good-first-bug has-patch |
Focuses: | ui, administration | 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 (5)
Change History (17)
This ticket was mentioned in Slack in #core by boone. View the logs.
8 years ago
#3
@
8 years ago
- Keywords needs-patch good-first-bug added
- Milestone changed from Awaiting Review to Future Release
Still seems like a good idea. Patch needed.
#4
@
8 years 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.
#7
@
7 years 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
#8
@
7 years ago
- Owner set to mariovalney
- Status changed from new to assigned
Assigning ownership to mark the good-first-bug
as "claimed".
#9
@
7 years ago
- Focuses template removed
- Keywords needs-patch added; has-patch removed
- Milestone changed from Future Release to 4.9
Thanks to @mariovalney and @riddhiehta02 for your patches!
Could I please get a single, unified patch that does the following:
- includes the description added by @riddhiehta02 in 30829.2.patch
- has correct indentation for the docblock (see https://make.wordpress.org/core/handbook/best-practices/coding-standards/php/#indentation)
- has a
@since
annotation for the newget_views()
method (see https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/php/#since-section-changelogs) - includes the call to
get_views()
in edit-tags.php from 30829-2.patch
As long as we get this patch, it should be no problem to add for 4.9.
#10
@
7 years ago
- Keywords has-patch added; needs-patch removed
Thanks for guidelines, @boonebgorges.
Thanks for description, @riddhiehta02.
I guess 30829.3.patch is done.
P.S.: sorry for wrong number on 39958.3.patch... hahahah
#11
@
7 years ago
Thank you, @mariovalney!
Earlier, I said that the views_edit-post_tag
filter was cumbersome to use. As I'm reviewing the most recent patches, I'm unsure why I thought this - the proposed new filter in 30829.3.patch return exactly the same kind of data as the generic views_{$screen}
filter. This is my mistake - my apologies for misreading the code. Any objections to just going with 30829.patch ?
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 introduceWP_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?