Multiple table imports mod
-
Just in case anyone else has this issue, or it inspires an extension:
Having many tables that I need to import and replace occasionally, doing this with a single Zip file is great. As I understand it the multiple table Zip import for TablePress relies on the csv files having the same name as the tables.
I name my tables all with a standard naming format eg Table0044.csv has id 44 in TablePress. To use the multiple table Zip import I have modded controllers\controller-admin.php, replacing
$existing_table_id = ( isset( $existing_tables[ $file_name ] ) && 1 === count( $existing_tables[ $file_name ] ) ) ? $existing_tables[ $file_name ][0] : false;
by
$existing_table_id = ((substr($file_name,0,5)==='Table') && (substr($file_name,-4) === '.csv')) ? ltrim( substr($file_name, 5, 4), '0') : false;
- The topic ‘Multiple table imports mod’ is closed to new replies.