I am trying to up date a form on a website that makes a dropdown list of all the sites available for registration on a WP Network site. It orders it by ID but I need to change that to Alphabetical. What it also does is there is a bit of code that allows some of the sites to not show in the list if that are marked as excluded. I also see that it is using code that is deprciated since wp 4.6 so it needs to be updated in general.
The issue is that I see that I don’t know how to do this and the original coder is long gone and my knowledge of this is limited.
Can anyone help me update this code to be up to current standards and sort by alphabetical?
<select id="blog2register" name="blog2register">
<option disabled="disabled" selected="selected" value="0000"> <?php _e(' - - - Choose a condo group to register for - - - ','msregister'); ?></option>
<?php
$args = array( 'limit' => 10000, );
$TheBlogs = wp_get_sites($args);
foreach($TheBlogs as $blog){
$theBlog = get_blog_details( $blog['blogname'], true );
if(get_site_option('msregister_blog1_id')!=$blog['blogname'] && get_site_option('msregister_exclude_'.$blog['blogname'])!='yes'){
echo '<option class="" value="'.$blog['blogname'].'">'.$theBlog->blogname.'</option>';
}
}
?>
</select>