Hello,
I’m trying to use this example to add several additional custom columns to the sitetable:
I inserted debugging output like this:
if (is_array($website_info) && isset($website_info['wpversion'])) {
customwp_logs($item['name']); // site name
$item['wpversion'] = $website_info['wpversion'];
And I’m surprised that this is called 7 times when the site table is refreshed in the browser.
The data to display has to be fetched from an external API. So I would fetch it 7 times which would be overkill
Is this by design or is there an easy way to prevent it?
If there is no workaround I’ll have to find a solution to “cache” the results somehow…
I’ve checked with the development team, and this is by design. It is being called 7 times because the sites table has 7 columns.
You can prevent it from being called that many times by using these hooks which will get the sites’ data as cached data: mainwp_sitestable_prepared_items mainwp_sitestable_website