Hi,
thanks for your post, and sorry for the trouble.
Sorry, there’s no JSON or XML file for that, you’d need to use a plugin filter hook and PHP code:
https://github.com/TobiasBg/TablePress/blob/master/models/model-table.php#L911
That filter hook offers an array of an empty table, in which you can set default values.
Regards,
Tobias
Hi @tobiasbg,
Thanks for the help.
I have tried to change the default values as such:
https://imgur.com/TYO2zGE
But it doesn’t seem to make any change.
Then I copy the block of code to functions.php, still the same.
Can you please let me know where I should place the code and where to call get_table_template() ?
Thanks
Hi,
sorry, I was a bit unclear. You’d need to use the filter hook function, i.e.
add_filter( 'tablepress_table_template', 'ryan0432_tablepress_table_template' );
function ryan0432_tablepress_table_template( $table ) {
$table['options']['datatables_sort'] = false;
$table['options']['datatables_filter'] = false;
return $table;
}
etc.
This could go into your theme’s “functions.php” file.
Note that these changes only apply to tables that are created or imported after adding this code!
Regards,
Tobias
Hey @tobiasbg,
It works. 😀 Now I have a better idea on how WordPress PHP works.
Was coming from other background and not having enough experience on coding.
Thanks a lot for helping me out 😀
Hi,
no problem, you are very welcome! 🙂 Good to hear that this helped!
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!