I have a loop that pulls in all sites in my multisite site network and loops through them to get variables located in their ACF options. Here is an excerpt from the code I am using:
$stageurl = array();
$args = array(
'public' => true,
'limit' => 500
);
$sites = wp_get_sites($args);
foreach ($sites as $site) {
switch_to_blog($site['blog_id']);
$stage = get_field('stage', 'option');
if (isset($stage)) {
$stageurl[] = $site['domain'];
}
restore_current_blog();
}
foreach ($stageurl as $i => $stages) {
...
}
Using wp_get_sites, how are sites sorted by default?
Ideally I would like to sort sites by their creation date before adding them to my foreach loop. Is it possible to find a network site's creation date and use it to sort my $stageurl array?