: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
class Utility_Multisite {
* Returns an array of all active multisite blogs (if `$blogIds` is `null`) or a list of active multisite blogs
* filtered to only those in `$blogIds` if non-null.
* @param array|null $blogIds
public static function retrieve_active_sites($blogIds = null) {
'number' => '', /* WordPress core passes an empty string which appears to remove the result set limit */
'update_site_meta_cache' => false, /* Defaults to true which is not desirable for this use case */
//Ignore archived/spam/deleted sites
$args['site__in'] = $blogIds;
if (function_exists('get_sites')) {
$blogIdsQuery = implode(',', wp_parse_id_list($args['site__in']));
return $wpdb->get_results("SELECT * FROM {$wpdb->blogs} WHERE blog_id IN ({$blogIdsQuery}) AND archived = 0 AND spam = 0 AND deleted = 0");
return $wpdb->get_results("SELECT * FROM {$wpdb->blogs} WHERE archived = 0 AND spam = 0 AND deleted = 0");