EP_API::get_sites PHP Method

get_sites() public method

Wrapper function for get_sites - allows us to have one central place for the ep_indexable_sites filter
public get_sites ( integer $limit ) : mixed | void
$limit integer The maximum amount of sites retrieved, Use 0 to return all sites
return mixed | void
    public function get_sites($limit = 0)
    {
        $args = apply_filters('ep_indexable_sites_args', array('limit' => $limit));
        if (function_exists('get_sites')) {
            $site_objects = get_sites($args);
            $sites = array();
            foreach ($site_objects as $site) {
                $sites[] = array('blog_id' => $site->blog_id, 'domain' => $site->domain, 'path' => $site->path, 'site_id' => $site->site_id);
            }
        } else {
            $sites = wp_get_sites($args);
        }
        return apply_filters('ep_indexable_sites', $sites);
    }