WP_ADDROLE::add_role( $user_id,  $action_data,  $recipe_id,  $args )

Validation function when the trigger action is hit


Parameters Parameters

$user_id

(Required)

$action_data

(Required)

$recipe_id

(Required)


Source Source

File: src/integrations/wp/actions/wp-addrole.php

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



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

		$user_obj = new WP_User( (int) $user_id );
		if ( $user_obj instanceof WP_User ) {
			$user_obj->add_role( $role );
			Automator()->complete->user->action( $user_id, $action_data, $recipe_id );
		}
	}