Hi,
thanks for your question, and sorry for the trouble.
Please see e.g.
https://ww.wp.xz.cn/support/topic/dynamically-populate-cell-contect/
https://ww.wp.xz.cn/support/topic/dynamic-table-data/
https://ww.wp.xz.cn/support/topic/display-all-data/
for example code for this.
Basically, that filter hook gets the full $table array and has to return the modified $table array. The table content is stored in the two-dimensional array $table['data'].
Regards,
Tobias
Thread Starter
blsn
(@blsn)
Thank you for your reply.
I created an empty table in the admin back-end and I managed to populate the table using $table['data'].
I am using the tablepress_table_render_data filter hook to show the table on the page.
How can I also edit the table through the admin back-end and show the results on the front page?
Thread Starter
blsn
(@blsn)
Hi,
Any response on my question above would be appreciated…
i.e.
Is it possible to edit/synchronize the same table from both admin (back-end) and PHP code.
$table['data'] = array(
array( "1", "2", "3" ),
array( "4", "5", "6" )
);
Hi,
that method of using the filter hook can only work just before output of the table. Thus, you will never see the data that is added via that method on the “Edit” screen.
All that is possible with that would be to keep some of the data from the “Edit” screen, simply by not creating a new $table['data'] array, but by only modifying it.
Regards,
Tobias