Skip to content

Instantly share code, notes, and snippets.

@JudeRosario
Created August 24, 2015 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save JudeRosario/5cf6923980380ee16a3a to your computer and use it in GitHub Desktop.
Save JudeRosario/5cf6923980380ee16a3a to your computer and use it in GitHub Desktop.
Add site users to other sites in WP Multisite
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