[wp-trac] [WordPress Trac] #42066: List tables: consider a new method to generate the views links markup

WordPress Trac noreply at wordpress.org
Mon Sep 19 21:06:23 UTC 2022


#42066: List tables: consider a new method to generate the views links markup
-------------------------------------------------+-------------------------
 Reporter:  afercia                              |       Owner:  costdev
     Type:  enhancement                          |      Status:  closed
 Priority:  normal                               |   Milestone:  6.1
Component:  Administration                       |     Version:
 Severity:  normal                               |  Resolution:  fixed
 Keywords:  has-patch has-unit-tests has-        |     Focuses:
  testing-info commit                            |
-------------------------------------------------+-------------------------
Changes (by davidbaumwald):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"54215" 54215]:
 {{{
 #!CommitTicketReference repository="" revision="54215"
 Administration: Add new `get_views_links` method to `WP_List_Table`.

 Many `WP_List_Table` child classes in core use mostly the same code to
 create their "view" links markup.  To DRY-up the code, a new
 `WP_List_Table->get_view_links` method is being introduced to consolidate
 the HTML link generation when provided an array of links.

 This change also implements this new method in the relevant
 `WP_List_Table_xxx` child classes `get_views` methods.  Finally, unit
 tests are being added to validate view links markup and test for some
 "unhappy paths".

 Props afercia, costdev, garrett-eclipse, Dharm1025, juhise, peterwilsoncc.
 Fixes #42066.
 }}}

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/42066#comment:29>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list