If you want to force add a MU user and activate them, and email them, this will do it. It’s a slightly altered version of a piece of the code in user-new.php.
wpmu_signup_user( $new_user_login, $new_user_email, array( 'add_to_blog' => $blogid, 'new_role' => $role ) );
$key = $wpdb->get_var( $wpdb->prepare( "SELECT activation_key FROM {$wpdb->signups} WHERE user_login = %s AND user_email = %s", $new_user_login, $new_user_email ) );
$ret = wpmu_activate_signup( $key );
The wpmu_activate_signup function will send the welcome email. And the $ret from wpmu_activate_signup is an array of several things, including the user_id in $ret[‘user_id’].
Obviously you’ll need to fill in the user name, email, blogid, and role in the above code.
Related Posts:
- Allow user to select a theme to install when they signup
- Password Reset for Users on a Multisite Subsite
- Overriding the default WP Multisite notification e-mail
- How to reset passwords for all users on a network using wp cli
- Stop wordpress from sending out moderation emails
- Emailing only the users of a MultiSites Sub-Sites
- How to make wp-signup.php a 1-step process [closed]
- Stuck with WordPress Multisite Custom signup page without .htaccess modification
- Password protect a single site on network
- Howto disable comment moderation emails for admins, but not for authors
- Multisite not using subdomains as hostname in from address when sending emails
- wp_mail() not sending email in multisite subdomain
- How can I add custom meta on signup page and pass along to be used after blog activation?
- Google Apps SMTP for WP MultiSite?
- How to show different sub sites based on Member’s user name In word press?
- How can I manually activate a new site in a wordpress multisite network?
- How to change a user role after registering in multisite?
- Activation Account Email
- Set my own password when registering a multisite user or site
- Multisite – SMTP not working on other network sites
- How to auto create site after user sign up on multisite(network)
- Sending SMTP mail using a server with self-signed SSL
- Multisite “Skip Confirmation Email” Log Out Problem
- How does adding custom meta to signup form work?
- Create service similar to wordpress.com [closed]
- Upload path/URL weirdness for the main blog of a multisite/network setup
- WP_Site_Query vs. WP_Network_Query in WordPress 4.6
- Multisite/network–automatic self-registration, blog setup
- Restrict users on multisite WordPress install
- Possible to make custom role in multisite that can add sites?
- Hierarchical Page Listing of all Pages in a Multisite Network
- Asian language multisite IDN subdomain
- Using separate Apache log files for multisite
- Deleting sites and users automatically in multisite
- Make default new sites https (multisite)
- How to move theme directory but not plugins/uploads out of WordPress root directory?
- WooCommerce lost password reset flow not working with SendGrid (redirect loop)
- How to get a user role of a specific blog in multisite?
- Logout issue with new Domain on WP Multisite
- Subdomain and subdirectories together in one installation
- WordPress Installation for multi-domains with nginx and php-fpm
- Max number of multisites
- Get users primary blog URL in MultiSite
- WordPress MU Domain Mapping Customizer Error
- Is it possible to setup multiple sites with a common pool of posts?
- Not able to access dashboard of subdomain
- How to stop unlink images when remove a site or user
- Multisite Redirect issue
- Multisites, upload issues, and iOS!
- How to allow WordPress users create sub-website or mini-website under my domain with any basic site builder?
- Multisite new sites not found(404), main site still works [closed]
- How to get option values set from all sites within a Multisite setup?
- Stop WordPress Entirely and Run My Own Code
- How to host blog on separate domain from main site
- What is meant by Multisite in WordPress?
- Allow Author on Site A capability to upload files on Site B in Multi Site
- Can you manage multiple domain names from a single WordPress multisite network?
- WordPress Multisite – Can 2 domains share a database of users?
- Can you create a local wordpress network / multisite install on a mac with subdomains?
- How to solve this issue
- What is the way to share data between sites in a multisite
- ERR_TOO_MANY_REDIRECTS when i config my subdomains
- Subsite access without being a member of the subsite in wp multisite network
- Redirect loop after activating wordpress multisite feature
- WordPress Network (multisite) — how to ensure each site has their own admin URL?
- WordPress multisite proper prefix attribution
- Is it possible for a child-site of a multisite to be a multisite itself?
- How to show only blog-domain instead of the whole permalink in the loop
- Multisite installation on an existing single installation
- Multisite Sub domains not working
- How can I change the email that is inside the default email texts of wordpress?
- Multiple subsites in a single wordpress installation
- WordPress multi-site: How do I create the home page, the root URL?
- WordPress Multisites or Multiple WP Single sites?
- Is it possible to query posts with tax queries after multisite switch_to_blog() function?
- $_SERVER[‘SERVER_NAME’] in WP_SITEURL
- Two installs conflicting – Pages redirecting
- Give users acces to admin a single post or set up WP network?
- WP-Cli Error When Mapping Multisite Subdomain
- WordPress Multisite for multi-language
- Send user auto generated password on different email
- WP Multisite Sub-Domain Error
- How to change lost password email text using custom plugin wordpress?
- WordPress multisite condition for certain blog_id’s
- the menu of the network does not display my second website
- Multisite – site user limited only for this site
- Get variable from previous blog while using switch_to_blog
- Nginx rules for subdomain multisite install (Bedrock)
- WP Admin Panel for Multi-site install not loading JavaScript for one Subdomain
- WordPress multisite not working
- multisite detect subsite blog number
- New multisite redirects to main site
- How to disable style filtering in post?
- Is it possible to create a login for restricted visibility?
- WP Multisite: Do a function after blog is activated
- multi-language multi-site with REST API
- How to make Multisite global login that redirects to correct subsite after login
- Advice on WP site structure using multisite
- How to login Separately in each blog?
- Redirect to Multisite site 2 if site 1 has a setting