[wp-trac] [WordPress Trac] #42066: List tables: consider a new method to generate the views links markup
WordPress Trac
noreply at wordpress.org
Sun Jun 19 07:21:15 UTC 2022
#42066: List tables: consider a new method to generate the views links markup
-------------------------------------------------+-------------------------
Reporter: afercia | Owner: costdev
Type: enhancement | Status: assigned
Priority: normal | Milestone: Future
| Release
Component: Administration | Version:
Severity: normal | Resolution:
Keywords: has-patch needs-testing has-unit- | Focuses:
tests dev-feedback |
-------------------------------------------------+-------------------------
Changes (by costdev):
* keywords: has-patch needs-testing has-unit-tests => has-patch needs-
testing has-unit-tests dev-feedback
Comment:
I've submitted [https://github.com/WordPress/wordpress-develop/pull/2828
PR 2828], which introduces `WP_List_Table::get_admin_status_links()` to
abstract link markup generation in list tables.
The PR includes PHPUnit tests for the new method and also implements the
use of this method in:
- `WP_MS_Sites_List_Table`
- `WP_MS_Themes_List_Table`
- `WP_MS_Users_List_Table`
- `WP_Plugins_List_Table`
- `WP_Plugin_Install_List_Table`
- `WP_Theme_Install_List_Table`
- `WP_Users_List_Table`
This is a more direct approach to the ticket's summary than using the
proposed general function mentioned earlier.
@afercia @peterwilsoncc @audrasjb Let me know your thoughts on this
method, and whether it should also cover the markup for `class="current"
aria-current="page"` and instead change the `"current"` key to `bool`
type.
Should a general function be preferred to cover link markup generation in
most cases, I drafted [https://github.com/WordPress/wordpress-
develop/pull/2380 PR 2380] for this, which also supports additional
attributes (including boolean attributes) and which is easily applied to
this use case.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/42066#comment:12>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list