Support

Account

Home Forums General Issues Add additional role to user Reply To: Add additional role to user

  • You add an acf/save_post action. In the action you get the value of the field and you get the user you want to add the role to and then you use $user->add_role().

    I don’t have any code example. It would really depend on what user you’re adding the role to. The user being edited or the user being updated. Also you’d have to deal with the eventuality of the value being changed so you’d need to look at removing roles as well.