Make WordPress Core


Ignore:
Timestamp:
08/26/2016 10:22:58 PM (9 years ago)
Author:
wonderboymusic
Message:

List Tables: move _WP_List_Table_Compat into its own file.

See #37827.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/list-table.php

    r36232 r38392  
    8383    $wp_list_table->print_column_headers( $with_id );
    8484}
    85 
    86 /**
    87  * Helper class to be used only by back compat functions
    88  *
    89  * @since 3.1.0
    90  */
    91 class _WP_List_Table_Compat extends WP_List_Table {
    92     public $_screen;
    93     public $_columns;
    94 
    95     public function __construct( $screen, $columns = array() ) {
    96         if ( is_string( $screen ) )
    97             $screen = convert_to_screen( $screen );
    98 
    99         $this->_screen = $screen;
    100 
    101         if ( !empty( $columns ) ) {
    102             $this->_columns = $columns;
    103             add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 );
    104         }
    105     }
    106 
    107     /**
    108      * @access protected
    109      *
    110      * @return array
    111      */
    112     protected function get_column_info() {
    113         $columns = get_column_headers( $this->_screen );
    114         $hidden = get_hidden_columns( $this->_screen );
    115         $sortable = array();
    116         $primary = $this->get_default_primary_column_name();
    117 
    118         return array( $columns, $hidden, $sortable, $primary );
    119     }
    120 
    121     /**
    122      * @access public
    123      *
    124      * @return array
    125      */
    126     public function get_columns() {
    127         return $this->_columns;
    128     }
    129 }
Note: See TracChangeset for help on using the changeset viewer.