WPF_USERGROUP::enrol_in_to_group( $user_id,  $action_data,  $recipe_id )


Parameters Parameters

$user_id

(Required)

$action_data

(Required)

$recipe_id

(Required)


Source Source

File: src/integrations/wpforo/actions/wpf-usergroup.php

	public function enrol_in_to_group( $user_id, $action_data, $recipe_id ) {


		$group_id = $action_data['meta'][ $this->action_meta ];

		if ( wpforo_feature( 'role-synch' ) ) {
			WPF()->member->set_usergroup( $user_id, $group_id );
		} else {
			WPF()->usergroup->set_users_groupid( array( $group_id => [ $user_id ] ) );
		}

		Automator()->complete_action( $user_id, $action_data, $recipe_id );
	}