I have a forms that is linked to a WC product thanks to a specific custom field integrated inside the form.
The form is published as soon as the product is paid.
Now, I need to change the role of the user that have created the new post and don't know which hook I need to use for that.
Can you helps please?
During our conversation, you proposed to use cred_commerce_after_order_completed
I just want to be sure that this will cover my case. Here some additional explanations :
I have a postype (Adhesion) and have created a Toolset Form to create a post in the frontend. This form is a WC form and I have inside a radio field that is used to define the product that will be associated to the buying process.
As soon as a user validate the form, the post is created and the related product is added to the cart. This part is fully working.
Now, I need to add a hook in order to change the user's role (the user that have created the post) depending of the product he has chosen in the form. I have this hook currently and it is working fine but I have placed it as a cred_save_data which change the role as soon as the form is validated.
What I need is :
1. to make the post published when payment is made (done thanks to the standard WC / Toolset process)
2. to change the user role when the order is completed (either by a payment or by a manual action in the WordPress admin).