BO_AWARDPOINTS_A::award_points( $user_id, $action_data, $recipe_id, $args )
Validation function when the trigger action is hit
Contents
Parameters Parameters
- $user_id
-
(Required)
- $action_data
-
(Required)
- $recipe_id
-
(Required)
Source Source
File: src/integrations/badgeos/actions/bo-awardpoints-a.php
public function award_points( $user_id, $action_data, $recipe_id, $args ) { $points_type = $action_data['meta'][ $this->action_meta ]; $points = Automator()->parse->text( $action_data['meta']['BOPOINTVALUE'], $recipe_id, $user_id, $args ); $point_type_id = 0; $credit_types = badgeos_get_point_types(); if ( is_array( $credit_types ) && ! empty( $credit_types ) ) { foreach ( $credit_types as $point_type ) { if ( $point_type->post_name === $points_type ) { $point_type_id = $point_type->ID; break; } } } badgeos_award_credit( $point_type_id, absint( $user_id ), 'Award', absint( $points ), '', false, '', '' ); Automator()->complete_action( $user_id, $action_data, $recipe_id ); }
Expand full source code Collapse full source code View on Github