Example #1
0
 /** 
  * REQUIRED! This method dictates the table's columns and titles. This should
  * return an array where the key is the column slug (and class) and the value 
  * is the column's title text. If you need a checkbox for bulk actions, refer
  * to the $columns array below.
  * 
  * The 'cb' column is treated differently than the rest. If including a checkbox
  * column in your table you must create a column_cb() method. If you don't need
  * bulk actions or checkboxes, simply leave the 'cb' entry out of your array.
  * 
  * @see WP_List_Table::::single_row_columns()
  * 
  * @return array An associative array containing column information: 'slugs'=>'Visible Titles'
  */
 public function get_columns()
 {
     $columns = $this->definition->columns();
     // Prepend checkbox 'cb' column if checkboxes are enabled
     if ($this->definition->enableCheckboxes()) {
         $columns = array_merge(array('cb' => '<input type="checkbox" />'), $columns);
     }
     return $columns;
 }