How-to assign custom role according to profile checkbox?
-
Hi,
I’ve added a checkbox in the UM profile, called
profile_notification
.
Then I’ve created a UM custom role calledno_notification
.And I would like to know how to automatically add the
no_notification
role to a user if in his profile the checkbox is unticked and remove thisno_notification
role if the checkbox is ticked?I got inspired by the bottom of this article (Programmatically apply a custom user role)…
https://usersinsights.com/wordpress-custom-role/
…but I need to adapt the code according to how I can get the UM profile checkbox value.Any idea?
Thanks!
- The topic ‘How-to assign custom role according to profile checkbox?’ is closed to new replies.