Display mysql datas into datatable.
Author: | Guillaume Raineri (profile at wordpress.org) |
WordPress version required: | 4.4 |
WordPress version tested: | 4.4.2 |
Plugin version: | 0.1 |
Added to WordPress repository: | 12-02-2016 |
Last updated: | 12-02-2016
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
|
Rating, %: | 100 |
Rated by: | 4 |
Plugin URI: | |
Total downloads: | 3 255 |
Active installs: | 40+ |
Click to start download
|
FAQ
How do I change default values?
You can edit the main dbTable2dataTable.php
file and change these values :
$this->defaults = array(
'from' => null, // Mysql source table
'select' => null, // Select specific columns
'except' => null, // Ignore specific columns
'cssclass' => null, // Specify custom CSS class for the <table>
'comments' => false, // Use field comments instead of column name
'pagination' => false, // Enable / Disable pagination
'limit' => 25, // Limit of results per page
'width' => '100', // Set width in % of the table
'language' => 'English' // Default language : French
);
What the `comments` attribut does?
By default, column names will be the field name (e.g: product_id, custom_field). But if you want to have custom/pretty names you should modify your table and add comments to the fields (e.g : ALTER TABLE product CHANGE product_id product_id INT( 11 ) COMMENT 'Product ID'
Why can’t I display datas from a WordPress Table ?
This plugin is not intended to display WordPress datas. I blocked this for security reasons. It aims to give you the ability to show custom datas from custom tables. I had to extract informations from an ERP and display them.
How can I force the plugin to shows WP tables ?
You can remove the security check line 58
by deleting or substr($atts['from'], 0,strlen($wpdb->prefix)) === $wpdb->prefix
Why the language doesn’t change?
You probably misstyped the language name. Make sure you write it exactly with the correct name.
Refer to : https://www.datatables.net/plug-ins/i18n/
E.g for french : //cdn.datatables.net/plug-ins/1.10.10/i18n/French.json
, the parameter will be French
with the first letter in uppercase.
ChangeLog