MYCRED_AWARDRANK_A::award_mycred_ranks( $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/mycred/actions/mycred-awardrank-a.php

	public function award_mycred_ranks( $user_id, $action_data, $recipe_id, $args ) {


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

		$rank_detail = mycred_get_rank( $rank_id );
		mycred_save_users_rank( $user_id, $rank_id, $rank_detail->point_type->cred_id );

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