I need to send an email if the a specific role is attribuited to an user. However the default wordpress action 'set_user_role' seems not to be called when using 'members'.
Also the:
do_action( ‘profile_update’, int $user_id, WP_User $old_user_data, array $userdata )
does not carry the new attribued role ( and neither can I retrieve using the $user_id, because at this point the user seems to still have the old roles).
Is there an action not documented called when changing, adding, editing an user's role? Looking trhought the code I could not see it.
I need to send an email if the a specific role is attribuited to an user. However the default wordpress action 'set_user_role' seems not to be called when using 'members'. Also the:
does not carry the new attribued role ( and neither can I retrieve using the $user_id, because at this point the user seems to still have the old roles).
Is there an action not documented called when changing, adding, editing an user's role? Looking trhought the code I could not see it.