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
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
WordPress® is a registered trademark of the WordPress Foundation, and WooCommerce® is a registered trademark of WooCommerce, Inc. MainWP is an independent product and is not affiliated, associated, or endorsed by the WordPress Foundation, WooCommerce, Inc., or Automattic Inc., except where noted under the Jetpack® API and Trademark License Agreement. All product names, logos, and brands are property of their respective owners and are used for identification purposes only.