opencredit / badgeos

BadgeOS is a plugin to WordPress that allows you to easily create badges and set up the steps and achievements users take to earn them. Badges are Mozilla OBI compatible and sharable via Credly.
http://www.badgeos.org
GNU Affero General Public License v3.0
92 stars 64 forks source link

having trouble accessing $user_id and $acheivment_id with badgeos_revoke_achievement #687

Open toobhed opened 4 years ago

toobhed commented 4 years ago

I want to access the user id and achievement id when an award is revoked. To test this and see what is being passed, I am making a database insert.

function check_award($user_id, $achievement_id) { global $wpdb; $wpdb->insert("wp_drl", array("results" => 'action called USER ID:' . $user_id . ' ACHIEVEMENT:' . $achievement_id) ); } add_action( 'badgeos_revoke_achievement', 'check_award', 10, 2 ); do_action( 'badgeos_revoke_achievement', $user_id, $achievement_id );

The row in the database ends up like this, no values for variables.: action called USER ID: ACHIEVEMENT:

What am I missing? Not having any issue doing something similar with badgeos_award_achievement