Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 

Repository files navigation

Custom-WP-Table

a simple file to paste in your plugin / theme to use WP-Table

Instruction: Paste file in your desired location and use below code:

$modified_table = new Modified_Table( $data, $columns ,$sortable);
$modified_table->prepare_items();
$modified_table->display();

Example data:

$columns = [
'id'      => 'ID',
'image'   => 'Image',
'name'    => 'Name',
'watt'    => 'Watt',
'actions' => 'Actions'
];  

$data = [
    [
        'watt'       => 0,
        'id'         => 1,
        'image'      => 'locahost/icon.svg',
        'name'       => "Product Name",
        'actions'    => '<a href="#action">Action</a>'
    ],
    [
        'watt'       => 0,
        'id'         => 2,
        'image'      => 'locahost/icon.svg',
        'name'       => "Product Name #2",
        'actions'    => '<a href="#action">Action</a>'
    ]
];
$sortable = array( 'id', 'name', 'actions', 'watt' )

About

A Custom table in WordPress based on WP-Table

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages