[wp-trac] [WordPress Trac] #56575: Make it possible to use custom class for Posts/Terms list table

WordPress Trac noreply at wordpress.org
Thu Sep 15 06:35:47 UTC 2022


#56575: Make it possible to use custom class for Posts/Terms list table
-------------------------+-----------------------------
 Reporter:  szaqal21     |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  General      |    Version:  6.0.2
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 Currently there is no simple way to use custom class for displaying posts
 list table on /wp-admin/edit.php or terms list table on /wp-admin/edit-
 tags.php.

 Both lists are being setup by _get_list_table() function.

 I've managed to use my custom implementation of WP_Posts_List_Table class
 by adding a filter to "views_edit-{$typenow}" and swapping global
 $wp_list_table like so:


 {{{
 add_filter("views_edit-{$typenow}", array(&$this, 'views_edit'));

 public function views_edit($views)
 {
         global $wp_list_table;

         $wp_list_table = new PTC_Posts_List_Table();

         ...
 }
 }}}
 but this isn't a perfect solution, it would be great to add some kind of
 filter (perhaps in _get_list_table()) to use custom class.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/56575>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list