Hi,
$table in this result only have id. Nothing more, but, I find out we can edit file models\model-table.php in 252 line.
$table = $this->load( $table_id, false, true); // Load table without data and options to save memory
Good luck to you
Hi,
thanks for your question, and sorry for the trouble.
Yes, the loading mechanism changed slightly, to make better use of caching.
You will therefore need to extend your code a little bit:
$tablepress_tables = TablePress::$controller->model_table->load_all();
foreach( $tablepress_tables as $table_id ) {
$table = $this->load( $table_id );
// $table is now the table array, with ID, name, and description
}
Please never modify plugins files, tdn2kit, this is never a good idea as you will again lose those changes after a plugin update.
Regards,
Tobias
Hi,
So, TobiasBg was right. I was change it back, with new fix:
$tablepress_tables = TablePress::$controller->model_table->load_all();
foreach( $tablepress_tables as $table_id ) {
$table = TablePress::$controller->model_table->load( $table_id );
// $table is now the table array, with ID, name, and description
}
Hi,
very nice! 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!
Thread Starter
grayg
(@grayg)
Hi!
Thank you all for your help..I tried the solution and works like a charm!
More power to your plugin!
Regards,
Gray
Hi,
no problem, you are very welcome! 🙂
Best wishes,
Tobias
P.S.: In case you haven’t, please rate TablePress here in the plugin directory. Thanks!