Delete results when a user is Unsubscribe

kobi
Forums
Hi Guys , Can I delete all the results of the tests when the user is no longer in the group ( course) ? Once the user leaves the group by the rule "User Expiration Cron" i want to delete all the results of the tests ( also in rule ) It is possible ? Kobi
Profile picture for user James Aparicio
James Aparicio

Hi kobi,

Hi kobi,

Yes for sure. It does not even have to be a cron function. You can just implement the hook_og_membership_delete.

http://www.drupalcontrib.org/api/drupal/contributions%21og%21og.api.php/function/hook_og_membership_delete/7

Best regards

kobi

Thanks James

where i put the code ? in the User Expiration module ? i don't know how to work with hook yet ( i am very new in drupal i am joomla user :) ) so I would be happy for any help kobi