• Hi,

    I have a process where a user is added to RoleA when checkout with WooCommerce subscriptions.

    Currently the user is appearing as having two roles (using other roles field).

    I was expecting that the existing role would be replaced and not added in addition to the role the user already had.

    1. Is this a feature of this plugin?
    2. Is there a way to disable it?

    Thanks for a fantastic plugin

    Elliot

    https://www.ads-software.com/plugins/user-role-editor/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Vladimir Garagulya

    (@shinephp)

    Hi Elliot,

    Multiple roles for user is a built-in feature of WordPress. It just doesn’t allow to work with multiple roles at your profile by default.
    I think if you deactivate User Role Editor, and test again, a user will still get 2 roles instead of 1.

    I suppose that your process uses WP_User::add_role() method, but it should use WP_User::set_role() method instead. In case WooCommerce adds its ‘customer’ role after your own process, try to fix it via ‘add_user_role’ action: wp-includes/class-wp-user.php

    Thread Starter Elliot Taylor

    (@raisonon)

    Thanks Vladimir – will contact WooCommerce Subscriptions about this (who add the user role).

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Other Roles (multiple roles)’ is closed to new replies.