Created
August 24, 2015 16:55
-
-
Save JudeRosario/5cf6923980380ee16a3a to your computer and use it in GitHub Desktop.
Add site users to other sites in WP Multisite
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'user_register', 'add_user_to_network_sites', 10, 1 ); | |
function add_user_to_network_sites( $user_id ) { | |
// Put sites here | |
$blogs = array ( 1 ,2 ,3 ,5 ,8) ; | |
foreach ( $blogs as $blog_id ) : | |
add_user_to_blog( $user_id, $blog_id , 'subscriber' ); | |
endforeach; | |
return | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment