15 class _WP_List_Table_Compat extends WP_List_Table { |
15 class _WP_List_Table_Compat extends WP_List_Table { |
16 public $_screen; |
16 public $_screen; |
17 public $_columns; |
17 public $_columns; |
18 |
18 |
19 public function __construct( $screen, $columns = array() ) { |
19 public function __construct( $screen, $columns = array() ) { |
20 if ( is_string( $screen ) ) |
20 if ( is_string( $screen ) ) { |
21 $screen = convert_to_screen( $screen ); |
21 $screen = convert_to_screen( $screen ); |
|
22 } |
22 |
23 |
23 $this->_screen = $screen; |
24 $this->_screen = $screen; |
24 |
25 |
25 if ( !empty( $columns ) ) { |
26 if ( ! empty( $columns ) ) { |
26 $this->_columns = $columns; |
27 $this->_columns = $columns; |
27 add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 ); |
28 add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 ); |
28 } |
29 } |
29 } |
30 } |
30 |
31 |
31 /** |
32 /** |
32 * |
|
33 * @return array |
33 * @return array |
34 */ |
34 */ |
35 protected function get_column_info() { |
35 protected function get_column_info() { |
36 $columns = get_column_headers( $this->_screen ); |
36 $columns = get_column_headers( $this->_screen ); |
37 $hidden = get_hidden_columns( $this->_screen ); |
37 $hidden = get_hidden_columns( $this->_screen ); |
38 $sortable = array(); |
38 $sortable = array(); |
39 $primary = $this->get_default_primary_column_name(); |
39 $primary = $this->get_default_primary_column_name(); |
40 |
40 |
41 return array( $columns, $hidden, $sortable, $primary ); |
41 return array( $columns, $hidden, $sortable, $primary ); |
42 } |
42 } |
43 |
43 |
44 /** |
44 /** |
45 * |
|
46 * @return array |
45 * @return array |
47 */ |
46 */ |
48 public function get_columns() { |
47 public function get_columns() { |
49 return $this->_columns; |
48 return $this->_columns; |
50 } |
49 } |