• Resolved assal0le

    (@assal0le)


    What is the Hook for awarding point only to the user? is this:

    badgeos_update_users_points

    how can I implement that hook in my function.php? please give me an example

    thx

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor Wooninjas

    (@wooninjas)

    Hello assal0le

    badgeos_update_users_points action runs when new points are awarded to any user.
    An example of using this hook:
    Available variables:
    * $user_id = ID of the user whom points are being awarded.
    * $new_points = Points to award
    * $total_points = User already earned points + New Points
    * $admin_id = If being awarded by an admin, the admin’s user ID
    * $achievement_id = ID of the achievement that generated the points, if applicable

    function your_function_name( $user_id, $new_points, $total_points, $admin_id, $achievement_id ) {
    // Do your stuff here
    }
    add_action( “badgeos_update_users_points”, “your_function_name”, 10, 5 );

    Thread Starter assal0le

    (@assal0le)

    Thanks for your replay @wooninjas,

    For this function, is it gives to the user only the point or point with a badge?

    Actually, what do I want is to give to the user only the point without a badge, is this possible?

    Plugin Contributor Wooninjas

    (@wooninjas)

    @assal0le
    This action hook only runs when new points are awarded to any user (in both cases, with badge / without a badge). If you are awarding any badge to the user (without points) then this action hook will not run.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hook for awarding point only to the user’ is closed to new replies.