The mainwp_getgroups filter may be used to retrieve information about the groups added to MainWP.


$sites = apply_filters('mainwp_getgroups', $pluginFile, $childKey, $groupId);


(string) (required) The plugin file is required here, mostly __FILE__
(string) (required) The child-key is required here, how to retrieve your child key is explained here
(integer) (optional) The id of the group you wish to retrieve

Return Values
An array that contains an array per group with the following keys: id, name, websites, where websites is an array of website ids.

Usage Examples

Display information about the groups:

Display the information of a the child-sites in a specific group (uses mainwp-getsites):