Gravity Forms Registration – Add User to Multiple Sites

Super Mario jumping endlessly to create bit coins.

You’ve got a scenario where someone is signing up to multisite via Gravity Forms’ user registration plugin. The following function will automatically add them to as many additional sites as you’d like.

add_action( 'gform_user_registered', 'many_site_registration_save', 10, 3 );

function many_site_registration_save( $user_id, $feed, $entry ) {
	$sites = array(25,26,27,28); //the IDs of the sites you want the user added to
	foreach ($sites as $site) {
		add_user_to_blog($site, $user_id, 'author'); //the last variable is the desired role for the user
	}
}

One thought on “Gravity Forms Registration – Add User to Multiple Sites

Comments are closed.