[wp-trac] [WordPress Trac] #15386: WP_List_Table::get_columns does not work for plugins

WordPress Trac wp-trac at lists.automattic.com
Sun Oct 30 17:53:46 UTC 2011


#15386: WP_List_Table::get_columns does not work for plugins
--------------------------+-------------------------
 Reporter:  ptahdunbar    |       Owner:  scribu
     Type:  defect (bug)  |      Status:  closed
 Priority:  high          |   Milestone:
Component:  General       |     Version:  3.1
 Severity:  major         |  Resolution:  worksforme
 Keywords:  needs-patch   |
--------------------------+-------------------------
Changes (by manutdotcom):

 * cc: manutdotcom (added)


Comment:

 When the array() argument is removed from line 24 (see screen.diff
 attachment), the table does tabulate properly without the need of
 initializing the WP_List_Table class before the page is loaded using
 add_action( "load-$screen_id", array( $this, '_init_list_table' ) ) as
 recommended in my-list-table-plugin.php above. The WP_List_table class can
 be initialized inside the function that was declared for add_menu_page().

 Then I would be able to dynamically render different tables according to
 the GET variable. Useful for tabbed pages.

 I was wondering since get_columns() do not require an input argument,
 maybe we could remove array() from line 24?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15386#comment:9>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list