Conversation
supportIn \lh-signup\partials\settings.php line ~56 you use get_sites(), which by default only returns 100 sites . My multisite has thousands, so this fails to show all possible templates. I also suggest filtering out spam/deleted/archived to leave only public sites; and only retrieving the list of ids. I suggest this code: $args = array( 'archived' => 0, 'deleted' => 0, 'fields' => 'id', 'number' => 0, 'public' => 1, 'site__not_in' => get_main_site_id(), 'spam' => 0, ); $subsites = get_sites($args); Another problem: The sites that are created have an incorrect site_url. First, we are on a subfolder structure (wordpress.somewhere.com/mynewsite), but your plug assumes (in the form and the PHP code) it is a subdomain structure (mynewsite.wordpress.somewhere.com). You can easily detect the difference from the constant SUBDOMAIN_INSTALL . All our sites have a domain e.g. wordpress.somewhere.com/mynewsite, but new sites are created with site_url=https://mynewsite2.somerewhere.com. In the same file at line 721, the template site has site_url=https://wordpress.somerewhere.com/mytemplate The problem is that get_new_subdomain() assumed site_url is not a full URL: line406:get_new_subdomain::Got parsedUrl=Array( [scheme] => https [host] => wordpress.somewhere.com [path] => /mytemplate ) line408:get_new_subdomain::Got host_parts=Array( [0] => wordpress [1] => somewhere [2] => com ) line410:get_new_subdomain::Set $host_parts[0]=mynewsite2 For subdomain installs, you should probably just replace the path part of the url. This topic was modified 3 years ago by buddywhatshisname .
Thankyou all good enhancements/fixes much appreciated. Just need to set up a sub folder test environment to implement and test
Thankyou all good enhancements/fixes much appreciated. Just need to set up a sub folder test environment to implement and test