예제 #1
0
 /**
  * Get page content html
  *
  * @return string
  */
 public function render()
 {
     echo '<div class="wrap">';
     echo "<h2>{$this->_title}</h2>";
     echo '<form method="get" action="">';
     echo "<input type='hidden' name='page' value='{$this->get_key()}' />";
     $this->_table->render();
     echo '</form>';
     echo '</div>';
 }
 public function admin_register_clients_table()
 {
     $table = new Table('users', 'ID');
     $table->setup_column('Avatar', __('Avatar', 'wpk15'), function ($item, $key) {
         return get_avatar($item['user_email']);
     });
     $table->setup_general_column('display_name', __('Name', 'wpk15'), null, $sortable = true, $searchable = true);
     $table->setup_column('user_email', __('Email', 'wpk15'), null, $sortable = true, $searchable = true);
     $table->setup_column('user_registered', __('Registered', 'wpk15'), null, $sortable = true);
     $table->add_action('View', function ($action, $item) {
         wp_redirect(get_edit_user_link($item));
         exit;
     });
     $admin_page = new TablePage('clients', __('Clients', 'wpk15'), 'users.php');
     $admin_page->set_table($table);
 }