So I have been researching for a while but to no avail. I am very new to php and back end WordPress functions.
I would like to create a function that when a user clicks on a link it updates their user role.
This function is needed because I am creating a staff induction site where they have to read a page and then when done click on a link to take them to the next part of the website, the changing of the role will let me know that they have read it and moved on to the next part.
I have basic understanding of the functions.php file and have been playing around with tutorials to understand how it works but I can't seem to wrap my head around what is needed to get this to happen.
A few similar links I've tried are:
- Wordpress: Change user role conditionally
- https://wordpress.stackexchange.com/questions/4725/how-to-change-a-users-role
But I couldn't work out from those what was needed.
Any help would be super appreciated.
Thanks!