Skip to content

Latest commit

 

History

History
24 lines (23 loc) · 957 Bytes

README.md

File metadata and controls

24 lines (23 loc) · 957 Bytes

wp-table-class

To use this class you have to require the class first.
require_once("wp-table-class.php");

load the class inside your page:
$WPTable = new wp_table_class;

Now the class is loaded you can use it like this:
$WPTable->set_columns(array(
     'ID' => 'ID',
     'user_login' => 'Username',
     'user_nicename' => 'Name',
     'user_email' => 'Email',
     'user_url' => 'Url'
));

$WPTable->set_sortable_columns(array('ID' => array('ID', false)));
$WPTable->prepare_items("SELECT * FROM wp_users");

To display the table you have to set the display, the display can be set inside divs.
$WPTable->display();

This is all you have to know to create a wordpress table