Introduce WP_List_Table::get_views_links().#2828
Introduce WP_List_Table::get_views_links().#2828costdev wants to merge 31 commits intoWordPress:trunkfrom
WP_List_Table::get_views_links().#2828Conversation
9dda2f6 to
c34e260
Compare
c34e260 to
8cdfecd
Compare
WP_List_Table::get_admin_status_links().WP_List_Table::get_views_links().
8cdfecd to
6fe0cbc
Compare
peterwilsoncc
left a comment
There was a problem hiding this comment.
Added a few notes inline.
A bit of extra escaping is needed as the highest priority item.
6fe0cbc to
6f02e78
Compare
peterwilsoncc
left a comment
There was a problem hiding this comment.
Thanks for the follow up.
My one last thought is about tests. There don't seem to be any tests for get_views() in the core test suite.
Would it be possible to add some to ensure the markup is equivalent on the old vs new?
6f02e78 to
525b54b
Compare
| number_format_i18n( $this->user_posts_count ) | ||
| ); | ||
|
|
||
| $mine = $this->get_edit_link( $mine_args, $mine_inner_html, $class ); |
There was a problem hiding this comment.
FYI: WP_Posts_List_Table::get_edit_link() is still used by:
WP_Posts_List_Table::column_author()WP_Posts_List_Table::column_default()
These can be replaced to use get_views_links(), but this would lose context.
This is another use case for a general function like the proposed wp_create_links().
54d4064 to
bffc00b
Compare
`WP_Posts_List_Table::get_edit_link()` is still used by: - `::column_author()` - `::column_default()` These can be replaced to use `get_views_links()`, but this would lose context. This is another use case for a general function like the proposed `wp_create_links()`.
This test was previously faulty and used the counts from a local install. This has now been resolved using: - `get_user_count()` for 'all' - `count( get_super_admins() )` for 'super'
bffc00b to
92a05b4
Compare
peterwilsoncc
left a comment
There was a problem hiding this comment.
LGTM but a minor change is needed to prevent the tests running in single site mode using the correct group.
Tests well when I pulled down the branch and applied it. I couldn't see any visual changes switching between this branch and trunk.
e50ef98 to
d26fdc0
Compare
|
Merged into core in https://core.trac.wordpress.org/changeset/54215. |
| number_format_i18n( $this->user_posts_count ) | ||
| ); | ||
|
|
||
| $mine = $this->get_edit_link( $mine_args, $mine_inner_html, $class ); |
This PR introduces
WP_List_Table::get_views_links()to abstract the link markup generation for list tables.Includes PHPUnit tests with full line/branch coverage.
Trac ticket: https://core.trac.wordpress.org/ticket/42066