[wp-trac] [WordPress Trac] #23122: inline doc improvements in WP_Filesystem_Direct and WP_List_Table

WordPress Trac noreply at wordpress.org
Mon Feb 18 17:33:55 UTC 2013


#23122: inline doc improvements in WP_Filesystem_Direct and WP_List_Table
-----------------------------+------------------
 Reporter:  bananastalktome  |       Owner:
     Type:  enhancement      |      Status:  new
 Priority:  normal           |   Milestone:  3.6
Component:  Inline Docs      |     Version:  3.5
 Severity:  trivial          |  Resolution:
 Keywords:  has-patch        |
-----------------------------+------------------

Comment (by kitchin):

 I suggest this at Line 576 in wp-admin/includes/class-wp-list-table.php
 {{{
          * Get a list of sortable columns. The format is:
          * 'internal-name' => 'orderby'
          * or
 +        * 'internal-name' => array( 'orderby', false )
 +        * or
          * 'internal-name' => array( 'orderby', true )
          *
 -        * The second format will make the initial sorting order be
 descending
 +        * The third format will make the initial sorting order be
 descending.
 +        *
 +        * If your class explicitly sets $this->_column_headers,
 +        * note the first format is invalid in print_column_headers().
          *
          * @since 3.1.0
          * @access protected
          *
          * @return array
          */
         function get_sortable_columns() {
                 return array();
         }
 }}}

 The problem with the first format is that print_column_headers() expects
 an array at line 686:
 {{{
 list( $orderby, $desc_first ) = $sortable[$column_key];
 }}}

 The first format is OK when it is rolled into an array by
 get_column_info(), but if you set _column_headers explicitly, then
 get_column_info() is bypassed. This is the approach taken by the API
 example plugin http://wordpress.org/extend/plugins/custom-list-table-
 example/ , which does use the correct second format.

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


More information about the wp-trac mailing list