[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-admin/includes/ -> class-wp-list-table-compat.php (source)

   1  <?php
   2  /**
   3   * Helper functions for displaying a list of items in an ajaxified HTML table.
   4   *
   5   * @package WordPress
   6   * @subpackage List_Table
   7   * @since 4.7.0
   8   */
   9  
  10  /**
  11   * Helper class to be used only by back compat functions
  12   *
  13   * @since 3.1.0
  14   */
  15  class _WP_List_Table_Compat extends WP_List_Table {
  16      public $_screen;
  17      public $_columns;
  18  
  19  	public function __construct( $screen, $columns = array() ) {
  20          if ( is_string( $screen ) ) {
  21              $screen = convert_to_screen( $screen );
  22          }
  23  
  24          $this->_screen = $screen;
  25  
  26          if ( ! empty( $columns ) ) {
  27              $this->_columns = $columns;
  28              add_filter( 'manage_' . $screen->id . '_columns', array( $this, 'get_columns' ), 0 );
  29          }
  30      }
  31  
  32      /**
  33       * @return array
  34       */
  35  	protected function get_column_info() {
  36          $columns  = get_column_headers( $this->_screen );
  37          $hidden   = get_hidden_columns( $this->_screen );
  38          $sortable = array();
  39          $primary  = $this->get_default_primary_column_name();
  40  
  41          return array( $columns, $hidden, $sortable, $primary );
  42      }
  43  
  44      /**
  45       * @return array
  46       */
  47  	public function get_columns() {
  48          return $this->_columns;
  49      }
  50  }


Generated: Mon Sep 23 01:00:03 2019 Cross-referenced by PHPXref 0.7.1