Looks interesting, thanks. Where should data tables plugin code be placed within your plugin? In its own js file under plugins/wpdatatables/assets/js/wpdatatables? And where could I put the initialization code so that it does not get overwritten on plugin updates?
You can put your custom JavaScript code in wpDataTables Custom JS field on wpDataTables settings page. Like that changes will not be overwritten with plugin update.
Also you can create WordPress Custom template and include new JavaScript file where you can add your custom code. Later you can use that WordPress Custom template on specific pages.
You can't copy whole code and past it. It is just an example how it can be done. It should be modified by you table and wpDataTable plugin. Something like that requires little custom coding.
Is there way to automatically hide empty columns on first load?
Hi Frank,
Thank you for your purchase.
Unfortunately something like this is not possible without custom coding. You can take a look at this solution how it can be achieved - Link
Looks interesting, thanks. Where should data tables plugin code be placed within your plugin? In its own js file under plugins/wpdatatables/assets/js/wpdatatables? And where could I put the initialization code so that it does not get overwritten on plugin updates?
Hi Frank,
You can put your custom JavaScript code in wpDataTables Custom JS field on wpDataTables settings page. Like that changes will not be overwritten with plugin update.
Also you can create WordPress Custom template and include new JavaScript file where you can add your custom code. Later you can use that WordPress Custom template on specific pages.
Ok, I went with the settings page method and inserted the code from your link. It does not work and gives console error:
for the line at the end:
Hi Frank,
You can't copy whole code and past it. It is just an example how it can be done. It should be modified by you table and wpDataTable plugin. Something like that requires little custom coding.
Hi Frank,
You can try to use datatables initComplete callback - https://datatables.net/reference/option/initComplete because we don't how our own callback that will work on table initialization.
Ok, thanks, you can close the ticket.