You’re using $user_id = get_option( 'admin_email' );
and then using that $user_id
. However, get_option( 'admin_email' );
returns an email address, not the int
that wpmu_create_blog()
expects. So your sites are (presumably) being created with a user_id
of 0
.
Here’s how I’d address this:
$user_email = get_option('admin_email');
$user_object = get_user_by( 'email', $user_email );
if ( false !== $user_object ) {
$user_id = $user_object->ID;
}
$id = wpmu_create_blog( $newdomain, get_network()->path, $domain, $user_id, $meta, get_current_network_id() );
References
Related Posts:
- WP Multisite – domain mapping to domain.com and separate site to domain.com/help
- Multisite Subdirectory with same domain subdomain
- WordPress Multisite with subdomains on different domains
- Can’t create a subdomain network – and WP is installed in webroot, not a folder
- Multisite network subdomains doesn’t work
- How to configure CNAMES to be part of a WordPress Network
- WP Multisite development with Mamp Pro and wildcard subdomains, not really working for me
- SSL wildcard issue for wp multisite subdomains
- Wildcard subdomain for the same site
- Create multiple subdomains for multi-site from a database
- WordPress Multisite. Can domain be used instead of subdomain?
- Listing of all site options in dashboard
- Set subdomains live in a next step
- Generate a user list per site to communicate upgrade plans
- Multisite installation combining subdomains and subdirectories
- Why can’t a WordPress network (multisite) in it’s own folder use subdomains?
- Subdomain multisite gives 404 on sub sites
- “Upgrade Network” error: stuck with SSL certificate verification
- Add New Sub Site from the WordPress back end then in sub site options table option_value must be with https
- Add new domain to ‘My Sites’ using network admin
- Changing Multisite URL after the subsite has been in use
- Sub-subdomain getting redirected to main domain
- Possible to create a multisite network where the main site is non-WP?
- On WordPress Network(multisite), Sub Blogs in Subdirectories or Subdomains? What’s better?
- Multisite Subdomain Using More Resources Than Others?
- Changing admin sub-domain in WordPress multisite
- Subdomain login problems
- How can I have multiple URLs pointing to single WordPress installation?
- Not able to access dashboard of subdomain
- Change Username?
- How to Redirect login User with Mapped Domiain Primary blog Url to Original Sub-site Url
- Can I use two different domain names with a WordPress multisite network?
- Why does the My Site dropdown show only a single domain?
- Redirect subdomain in Multisite installation?
- problem with main site (root domain) redirects to subdomain (multisite)
- How to redirect one page on the subdomain
- Include only a domain path in multisite Network
- Start with multi-site feature now or later?
- Adding new sites to Multisite won’t register in Dashboard
- Multisite – 404 when accessing sub-sites
- WordPress Network admin options page: how to store options and where will they be stored?
- Migrating wordpress multisite and domain mapping plugin
- Is the Multi site functionality a viable option for Country and Language targeting?
- Multisite not using subdomains as hostname in from address when sending emails
- ERR_TOO_MANY_REDIRECTS when i config my subdomains
- How to create a Multi-Network subsite?
- Redirect to localhost after installing Multisite on server
- Login problems on multisite installation with different domains
- One Domain, Two Installs of WordPress
- HTTPS Warning and Certificate Error when Updating Network
- Multisite, with virtual root
- How to show only blog-domain instead of the whole permalink in the loop
- WordPress MU subdomain vhost
- wp_get_attachment_image_src on multisite
- How do I check if the user is a site owner in a network?
- Install multisite wordpress on a subdomain and map to top level domains
- Creating a subdomain network in a subdomain
- WordPress Multisites or Multiple WP Single sites?
- Https and Http Login Issue on WordPress Multisite
- How to use different domains subdomains in WP multisite? [duplicate]
- How to have one installation at blog.example.com and multiple blogs in sub folders such as blog.example.com/userA?
- Forward and mask a WordPress website
- unable to access network admin of a blog
- Multisite for main in subdirectory, subdomain and subfolders (EN/ES)
- Subdomain is not working
- Website not listed under Sites (in a Network environment)
- Sites network with sub-folders
- Add Network Sites are not working
- WordPress Multisite and how to apply sef urls only to specific sites
- How can I have two or more WordPress Pro (paid) themes that form a single website?
- multisite installed on subdomain now want another subsite on subdirectory
- Getting stylesheet error after setting subdomain to false in multisite
- How to hold posts and accounts for moderation on WordPress Network site
- After switch domain, some parts of my site still point to my old domain
- WordPress Multisite with Wildcard Certificates not mapping correctly
- Looking for most efficient way to ‘deploy’ single wordpress page to multiple external subdomains
- Multisite installation steps?
- Installing other applications alongside WordPress multisite subdomains
- Change header.php of a specific WordPress Multisite
- the menu of the network does not display my second website
- How to connect existing subdomains to new wordpress multisite?
- WordPress Multisite Network Subdomain
- network admin pages not linked to correctly
- Multisite WordPress Configurtion
- Using both subdirectory and subdomains in Multisite
- Multisite, different domains, optional subdirectory, and htaccess
- How to apply specific plugins to affect all sites (Multisite Network)
- Admin user getting redirected to /wp-admin/user
- Getting 404 after Update in Multisite
- Subdomain Wp-Admin Not Found
- Some Subdomains on a Multisite Install Not Found
- Is it possible to put a site other than #1 as a Multisite top-level domain?
- 4th Network Site Database Errors?
- How to display update message only to admin
- How to disable admin access on new site registration for user in Multisite?
- Multi site root site installed on subdomain, with child sites as subdirectories
- Integrating WordPress for blog and other content pages in a web app
- Cookies in Multisite network where sites have their own domain name?
- Make multisite non-existing subdomains go to homepage instead of Index of/ page
- Multisite subdomain microsite on secondary domain