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

WordPress Trac noreply at wordpress.org
Tue Jun 21 15:50:16 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                             |
-------------------------------------------------+-------------------------

Comment (by davidbaumwald):

 Is there any reason that "status" is being used here, other than that's
 mostly what Core is using for different views?

 Personally, I've long wished for a `get_views` method in the list table.
 I usually end up recreating the code in my final.  These views could be
 used for many more things other than "status", so I don't think we should
 lock in on that.

 Going back to the original request in the ticket, can we not just promote
 `get_views` to the parent class with a default output that outputs HTML
 for link data in an array for a new property `views`.  If it's not set,
 `get_views` doesn't output anything.  Extending classes could just add
 their links to the `views` array.  The output would be default unless the
 extending class overrides `get_views`.

 If I've missed the case against doing this, I apologize in advance.

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


More information about the wp-trac mailing list