Hi @ericstz
Are you talking about changing the user role.?
Hi @markhf
Yes exactly, i want to change the wordpress’s status of user after a subscription
Thanks for your help
Éric
Hi @ericstz
We have a filter in the plugin while creating a new subscription. Please see below.
do_action( 'hf_subscription_updated_users_role', $new_role, $user, $role_old );
You may use this hook to do your necessary changes.
Hi @markhf
Thanks for your answer, but I don’t see where in the plugin I can have this filter. In product part of woocommerce ?
Thanks,
Eric
Hello Eric ( @ericstz ),
Please add below code snippet in your active theme functions.php
add_filter('hf_subscription_updated_users_role', 'assign_role_after_subscription', 10, 3);
function assign_role_after_subscription($new_role, $user, $role_old) {
$role = 'mycustomrole'; // string $role = Role name
$user->add_role( $role );
}