WordPress.org

Ready to get started?Download WordPress

Forums

Members
[resolved] Extra or hidden capabilities not showing in members plugin (9 posts)

  1. Starejosel
    Member
    Posted 1 year ago #

    I am using the members plugin with the role manager enabled. When I show the various roles under the users menu, it gives a count of their capabilities. When I select a role to edit, it shows the capabilities of the role–however, it shows fewer capabilities than the number shown in the count. The more capabilities the role has, the greater the number of hidden capabilities–for example, the administrator role has 93 roles in the count, but only 82 show up when I select the edit button for it. Is there a way to show the hidden capabilities? Why are they there? Is this something to worry about? Any information would be appreciated.

    Thanks!

    http://wordpress.org/extend/plugins/members/

  2. tzeldin88
    Member
    Posted 1 year ago #

    Did you ever find an answer to this?

  3. Starejosel
    Member
    Posted 1 year ago #

    Nope--still curious.

  4. tzeldin88
    Member
    Posted 1 year ago #

    It may not be very relevant to you, but the context in which I encountered this issue of "hidden" capabilities was while troubleshooting problems resulting from a recent update of bbPress (a forum plugin from automattic). In researching it, I found some info about how WP handles Roles that I never knew, and it pointed my thinking in the right direction.
    http://bbpress.org/forums/topic/roles-and-capabilities-in-bbpress-2-2/

  5. Starejosel
    Member
    Posted 1 year ago #

    Thank you, that is very helpful.

    Martin

  6. Starejosel
    Member
    Posted 1 year ago #

    Thank you, that is very helpful. I see that many of the capabilities of the roles have
    changed, and the number has decreased drastically.

    Martin

  7. jazbek
    Member
    Posted 1 year ago #

    I'm also seeing this with roles created by WooCommerce. The customer role is listed in the Roles list as having 3 capabilities, but when I click to edit it, only "read" is checked.

    I need to create another type of customer that has access to discounts, so I'd like to duplicate the existing Customer role and add an additional capability to it, however, i can't duplicate the existing Customer role if I can only see 1 of its 3 capabilities.

  8. somethumb
    Member
    Posted 1 year ago #

    I can clear this up. In the WooCommerce plugin, the file woocommerce.php creates both the Customer role and the Shop Manager role using the built-in WordPress function add_role. Notice that the Customer role does have 3 capabilities assigned. Notice that although the 3 capabilities are assigned, only one of them is true (read) and the edit_posts and delete_posts capabilities are false. This means that when looking at the checkboxes in the Roles section of the Members plugin, only the read role will be checked (because the others are false and unchecked!). So even though it says 3, it's only really 1 true capability. Therefore if you create a duplicate role (let's say Wholesaler), and only check the read capability, it will show as 1 capability, which is completely correct, because the other capabilities are false and unchecked. And since you assigned it using the Members Plugin tool, and not via a function that assigns other capabilities false, you won't see the matching 3 capabilities, you'll only see the 1. I've used this with WooCommerce Dynamic Pricing and it works perfectly!

  9. jazbek
    Member
    Posted 1 year ago #

    Thank you somethumb! That is super helpful information. I am also planning to use this with Dynamic Pricing, so now I can move forward with creating the additional customer level. Thank you so much for sharing, really appreciate it.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic