Groups

Groups is a WordPress plugin that provides group-based user membership management, group-based capabilities and content access control. It integrates standard WordPress capabilities and application-specific capabilities along with an extensive API.


Extensions

New Groups Restrict Categories and Groups Import Export.

  • Groups 404 Redirect allows to redirect visits to pages that are protected by Groups.
  • Groups Blog Protect restricts access to blogs based on group membership.
  • Groups File Access Groups File Access is an extension that allows to provide file download links for authorized users. Access to files is restricted to users by their group membership.
  • Groups Forums provides a powerful and yet light-weight forum system for WordPress sites.
  • Groups Gravity Forms allows to add users to groups automatically, based on form submissions.
  • Groups Import Export – An import and export extension for Groups.
  • Groups Jigoshop Groups integration for Jigoshop that supports memberships and subscriptions.
  • Groups Newsletters helps you to communicate efficiently, providing targeted information to groups of recipients through automated campaigns.
  • Groups Notifications allows to send automatic notifications to group members and the site administrator.
  • Groups PayPal – Sell memberships and subscriptions with Groups and PayPal.
  • Groups Restrict Categories features access restrictions for categories, tags and other WordPress taxonomies, including support for custom post types and taxonomies.
  • Groups Restrict Comments Pro This extension for Groups allows to restrict who can post or read comments based on a user’s group membership.
  • Groups Subscriptions is a subscription framework for Groups.
  • Groups WooCommerce Groups for WooCommerce is a WordPress plugin that allows you to sell memberships.
  • WooCommerce Group Coupons This extension for WooCommerce uses Groups and WordPress roles to limit the validity of coupons.
  • WooCommerce Groups Newsletters The WooCommerce Groups Newsletters extension lets customers subscribe to newsletters at checkout.


Features

User groups

  • Supports an unlimited number of groups
  • Provides a Registered group which is automatically maintained
  • Users can be assigned to any group
  • Users are added automatically to the Registered group

Groups hierarchy

  • Supports group hierarchies with capability inheritance

Group capabilities

  • Integrates standard WordPress capabilities which can be assigned to groups and users
  • Supports custom capabilities: allows to define new capabilities for usage in plugins and web applications
  • Users inherit capabilities of the groups they belong to
  • Groups inherit capabilities of their parent groups

Access control

  • Built-in access control that allows to restrict access to posts, pages and custom content types to specific groups and users only
  • control access to content by groups: shortcodes allow to control who can access content on posts, show parts to members of certain groups or to those who are not members Shortcodes: [groups_member], [groups_non_member]
  • control access to content by capabilities: show (or do not show) content to users who have certain capabilities Shortcodes: [groups_can], [groups_can_not]

Easy user interface

  • integrates nicely with the standard WordPress Users menu
  • provides an intuitive Groups menu
  • conceptually clean views showing the essentials
  • quick filters
  • bulk-actions where needed, for example apply capabilities to groups, bulk-add users to groups, bulk-remove users from groups

Sensible options

  • administrator overrides can be turned off
  • optional tree view for groups can be shown only when needed
  • provides its own set of permissions
  • cleans up after testing with a “delete all plugin data” option

Access Control

Groups defines some capabilities of its own. The groups_read_post capability is used to restrict access to certain posts or pages to groups (and users) with that capability only.

Framework

  • Solid and sound data-model with a complete API that allows developers to create group-oriented web applications and plugins

Multisite

  • All features are supported independently for each blog in multisite installations

Your opinion counts

You & Groups

Beta-testers and developers who need to integrate group-based features in their plugins and web applications: please use it and provide your feedback.

Feedback

Feedback is welcome!

If you need help, have problems, want to leave feedback or want to provide constructive criticism, please do so here at the Groups plugin page.

Please try to solve problems there before you rate this plugin or say it doesn’t work. There goes a lot of work into providing you with free quality plugins! Please appreciate that and help with your feedback. Thanks!

Twitter

Follow me on Twitter for updates on this and other plugins.

Introduction

Content Access Control

Access restrictions on posts

On posts an pages (and custom content types) a new meta box titles Access restrictions appears. By checking Enforce read access, you can restrict access to the post to groups and users who have the groups_read_post capability. You need to assign this capability to a group and make users members of that group to allow them to see those posts.

Content visibility for members and non-members

The [groups_member] and [groups_non_member] shortcodes are used to limit visibility of content to users who are members of a group or users who are not members of a group. Multiple comma-separated groups can be specified.

Example: Limiting visibility of enclosed content to registered users.

[groups_member group="Registered"]

Only registered users can see this text.

[/groups_member]

Content visibility based on capabilities

The [groups_can] and [groups_can_not] shortcodes limit visibility of enclosed content to those users who have the capability or those who do not have it. Multiple capabilities can be given.

Example: Showing enclosed content to users who can edit_posts (standard WordPress capability).

[groups_can capability=”edit_posts”]

You can see this only if you have the edit_posts capability.

[/groups_can]

Integration in the ‘Users’ menu:

Users – group membership is managed from the standard Users admin view. Users are automatically added to the Registered group. You can add multiple users to other groups here and also remove them.

Sections in the ‘Groups’ menu:

Groups

Here you can:

  • add groups
  • remove groups
  • assign capabilities to groups

Capabilities

This is where you add, remove and manage capabilities.

Capabilities can be assigned to groups and users (1). These capabilities include the standard WordPress capabilities but you can also define additional capabilities for your web-application.

Groups defines some capabilities of its own. The groups_read_post capability is used to restrict access to certain posts or pages to groups (and users) with that capability only.

(1) Assigning capabilities to users is not integrated in the user interface yet but can be done through API calls.

Options

Administrator override :

Administrator overrides can be turned off.

Permissions :

For each role these permissions can be set:

  • Access Groups: see information related to Groups.
  • Administer Groups: complete control over everything related to Groups.
  • Administer Groups plugin options: grants access to make changes on the Groups > Options admin section.

Testing the plugin :

A convenient option is provided to delete all data that has been stored by the Groups plugin. This option is useful if you just need to start from fresh after you have been testing the plugin.


Shortcodes

Please visit the documentation page on shortcodes for up-to-date information: Groups Shortcodes


Download

Download the Groups plugin on WordPress.

1,502 Responses to Groups

  1. Jerry February 8, 2015 at 12:19 am #

    I apologize in advance for my inability to decipher the API. Unfortunately I’m very new to it and don’t know what to look for much less apply. I have a group titled Premium. How do I use the API to restrict access within my theme? Specificity would be greatly appreciated. Is it anything like:
    Restricted content Public Content

    TIA

  2. Steve February 8, 2015 at 4:52 pm #

    Hi, I’m using both Groups and WooCommerce Groups. I’m using the combination to limit access to specified posts to Members. I have a “Recent News” area on my home page that lists posts in specified categories. Some of them are for members only, some open to everyone.

    Is there a way to show an “indicator” that informs the site visitor a specific link is for “Members Only?”

    Right now, I’m using the Groups 404 Redirect. If they click on it, they are directed to the “hey, you need to be a member” page. But displaying an indicator would be ideal.

    Imagine something like this…
    http://mtac.spidercreations.net/wp-content/uploads/2015/02/member-content.jpg

    Suggestions?

  3. Nate February 13, 2015 at 1:25 am #

    I’ve installed the Groups plugin. When I create a new post using shortcodes to control content visibility the shortcodes show up in the wordpress new post notification emails.

    [groups_non_member group="vip"]

    [/groups_non_member]

    • kento February 16, 2015 at 8:15 pm #

      What plugin are you using to produce these emails? The plugin seems to skip the shortcode evaluation of WordPress when it prepares the content it is sending. Unless that’s intended, it’s a bug in that plugin.

  4. mircire February 15, 2015 at 8:03 am #

    I am using this plugin to restrict access to mandarin lessons on my site. We have three courses and students register for ten week classes covering one of the courses. For example, the course name is “ML1″ and the class name is “2015/2A-ML1″. Corresponding to the classes there are groups with the same name (eg “2015/2-ML1″) with a parent named “ML1″. In order to verify access privilege, we hope to check if the user is a member of the parent group (eg “ML1″). I thought that Groups_Access_Shortcodes::groups_member() would provide this functionality, but it does not. I can probably hack something together, but it seems like there must be some useful API that you guys are already exposing. Thanks for the great plugin! — especially if I can get this feature to work.

    • kento February 16, 2015 at 8:41 pm #

      Hi,

      Sure, please have a look at the API section of the documentation. Many thanks for your feedback on the plugin and don’t hesitate to ask if you have questions on the API usage.

      Cheers

  5. mirgcire February 15, 2015 at 9:32 pm #

    I am puzzled about the purpose of a parent group. I would expect that adding a user to a group, would automatically add them to the parent group. But this does not seem to be the case. This feature is desirable in my application (providing Mandarin Chinese classes, where multiple classes share the same online materials, but have different groups of students). So I decide to add the feature by hooking the ” action.

    [code]
    function groups_created_user_group($user_id, $group_id) {
    $group = Groups_Group::read( $group_id );
    $parent_id = $group->parent_id;
    if (!empty($parent_id)) {
    Groups_User_Group::create( array( ‘user_id’ => $user_id, ‘group_id’ => $parent_id) );
    }
    }
    [/code]

    So I have two questions
    1) What is the parent ID for?
    2) It there a better way to make it work?

    Thanks

    • antonio February 25, 2015 at 10:03 am #

      Hi,
      user is not automatically added to the parent group, but capabilities are inherited. So if you create as ‘Alumns’ group with capability ‘alumns’ and a ‘Chinese’ group (with ‘chinese’ capability) with parent ‘Alumns’.
      If you have a restricted post to ‘Alumns’, this can be readed by ‘Alumns’ and by ‘Chinese’.
      If you have a restricted post to ‘Chinese’, this can be readed by ‘Chinese’ but not by all ‘Alumns’
      chees

      • mirgcire March 11, 2015 at 6:31 pm #

        Thanks!
        I get it.
        Now I have a follow up question.
        Is it possible to have multiple parents?
        I would like my classes to have the capabilities of one parent group, and belong to a calendar quarter to make it easier to count the number of students per quarter.

        • antonio March 12, 2015 at 7:10 am #

          Sorry, you can only have a parent. You should add your classes to several groups.
          cheers

  6. Bobby Small February 16, 2015 at 4:18 pm #

    When I’m logged in as a paid/premium user (i use the woocommerce extension), I can see the content within the groups_non_member shortcode. I’d like this to be hidden so that it’s only shown to non-members and people not logged in. Why is it still showing?

    • kento February 16, 2015 at 9:11 pm #

      How exactly are you using the shortcode please?

  7. Dave February 16, 2015 at 7:34 pm #

    Is there some way to expand WP registration that integrates well with “Groups”? I’d like to be able to use an expanded registration plugin with Groups instead of trying to use S2 Membership which doesn’t play nicely with Woocommerce.

    TIA.
    Dave

  8. Bobby Small February 16, 2015 at 9:54 pm #

    Looks like I figured it out. i didn’t realize you had to put the group name in the not_member shortcode too :)

    • Adrian February 28, 2015 at 4:44 am #

      OMG I just spent 4 hours trying to do the same thing!! Thanks for posting your findings! If it wasn’t for me reading your post I would have never known.. Who would have thought you had to include the group name in the not_member shortcode too! You would think this would be clearly stated on this page.. Anyway many thanks!

      • antonio February 28, 2015 at 8:44 am #

        Thanks, we’ll review the documentation.
        cheers

  9. Tim February 17, 2015 at 3:32 pm #

    Is there a way to have access controls be disabled automatically for non-public post types? I have several hierarchical private custom post types with thousands of posts each, and having access controls on edit.php really slows down page load time (I’ve made the post types public and disabled access controls, just to see the difference). The options page currently only shows public post types.

    • kento February 26, 2015 at 8:33 pm #

      Thanks Tim, this sounds familiar in case you’ve already gotten a reply, but I’ve taken note to review and add a possible option for that.

  10. Artus February 17, 2015 at 8:42 pm #

    Is there a way to add pagination and search in a fronted displayed list of users? or can someone explain how to do it?
    Thanks.

  11. Jack February 17, 2015 at 9:34 pm #

    Hi,
    I’m wondering why this wont work.

    Content is shown regardless of group membership.
    I need to restrict content at a theme level, I’m unable to find how this can be done in the documentation.
    Thanks in advance,

    • antonio February 18, 2015 at 8:30 am #

      Hi,
      please have a look to this comment.
      cheers

  12. Tim February 18, 2015 at 2:22 pm #

    Can you please either disable access controls on private post types by default, or give us the ability to control which post types receive access controls via the options page?

    • kento February 19, 2015 at 8:56 pm #

      Thanks for asking Tim but you already have that option under Groups > Options :)

      • Tim February 24, 2015 at 12:45 pm #

        We don’t though. Private post types don’t show up in this list, but access restrictions are on by default for them. The problem is line 226 of lib/admin/groups-admin-options.php which only pulls in public post types for the list of checkboxes. There’s no way to deselect private post types.

        • kento February 24, 2015 at 8:05 pm #

          Thanks for pointing that out Tim, I’ll take that into account for review.

  13. wayne February 19, 2015 at 2:46 pm #

    Are there any easy ways to show widgets based on user groups / conditions?

    • kento February 19, 2015 at 8:52 pm #

      Hi Wayne,

      Thanks for asking, I’ve replied already on Twitter but since you’ve already posted here and it’s a good question:

      Currently it’s not implemented as an option on the admin user interface, you would have to implement it using Groups’ API and a way that allows to show widgets based on conditions such as https://wordpress.org/plugins/widget-logic/ – I think it lets you evaluate code directly so you wouldn’t have to implement the whole logic behind it …

      Cheers

  14. Janelle February 20, 2015 at 3:42 am #

    When using get_posts($args); the private posts disappear from the loop. Is there a way / loop to show the posts as a title list but get restricted when they access the main post page?

  15. Dan February 20, 2015 at 10:11 pm #

    This plugin looks as if it’s very easy to use, but I there are 2 features I would love to see:

    1. Ability to manage/group users at the Super Admin level under the Network Admin area
    2. Ability to create groups based on user meta (NOT just capabilities)

    • kento February 21, 2015 at 11:51 am #

      Hi Dan,

      Thanks for the suggestions. I agree with #1 and would like to see that, too. For #2 could you explain a use case for that please?

      Cheers

      • Dan February 23, 2015 at 12:57 pm #

        For suggestion #2: I have users being registered and choosing a specific day of the month. The Day of the Month field is created by using custom user meta. I would like to create different user groups based on the Day of the Month. A user that is registered with the value of 1 would be in the Day One group, the user that is registered with the value of 2 would be in the Day Two group, and so on. The end goal is to sync each group with a Mailchimp or Constant Contact list.

        Also, is suggestion #1 in the development?

        • kento February 28, 2015 at 12:34 pm #

          Hi Dan,

          Thanks for explaining that, if you just want to sync the users to MailChimp maybe eggemplo’s Groups2Mailchimp would be sufficient?

          On #1 yes we’re working on that, can’t give an ETA though.

          Cheers

  16. Jade February 23, 2015 at 8:12 pm #

    Am I doing something wrong? Please help.

    [groups_can capability=”info”]
    My group members have info capability but they can not see this.
    [/groups_can]

    And:
    [groups_non_member="Registered"]
    Every user can see this. My registered users can see this text.
    [/groups_non_member]

    I tried different combinations but nothing works:

    [groups_can capability=”edit_posts”]
    I gave my group edit_posts capability. It did not work
    [/groups_can]

    And:
    [groups_member group="1"]
    It did not work.
    [/groups_member]

    • kento February 25, 2015 at 6:37 pm #

      Hi Jade,

      Here’s an example you can use, you need a Donut group that has the donut capability and the user viewing the page should be logged out or logged in and be a member of the Donut group:

      [groups_can capability="donut"]
      You can donut.
      [/groups_can]

      [groups_non_member group="Registered"]
      You're not logged in.
      [/groups_non_member]

      [groups_member group="Donut"]
      You're in the Donut group.
      [/groups_member]

      Cheers

  17. Margit February 24, 2015 at 7:49 am #

    I have differnt woocommerce products for members and non-members.
    I would like for my member to no longer see the products for non-members.
    Is this possible?

    • antonio February 24, 2015 at 8:03 am #

      Yes,
      in your product edit page you have a ‘Access restrictions’ box to restrict access.
      cheers

  18. Dave Moppert February 26, 2015 at 4:27 am #

    Any idea how display different menu items in the nav based on what group the member is assigned to? Would really love this functionality.

  19. Mette February 26, 2015 at 8:29 am #

    We have an issue of needing to restrict number of times a user gets access to a page (to view paid content). Is this in anyway possible to restrict? To put a “number of credit” on a group, so when credit is reached/used up membership of the group ends.

    Regards,
    Mette

    • antonio February 27, 2015 at 11:38 am #

      Sorry,
      this feature is not available in the plugin. If you need to create your own solution, you have available Groups API.
      cheers

    • kento February 27, 2015 at 8:39 pm #

      Hi Mette, it’s an idea worth exploring. What kind of content do you want to restrict access to? I’m asking to see if the content container or storage mechanism could be used to limit the number of times it can be viewed, or if it’s necessary to leverage a (currently unavailable) feature in the Groups framework.

  20. Nigel February 27, 2015 at 3:53 am #

    I’ve set up a product, created and allocated a group to it, but when payment is completed, the membership is not assigned to the user. What could be wrong here?
    Thanks

    • antonio February 27, 2015 at 9:37 am #

      Hi,
      please be sure you have ‘Processing’ as ‘Add users to or remove from groups as early as the order is …’ in Woocommerce->Groups.
      cheers

  21. Chris February 27, 2015 at 5:55 am #

    I am trying to use the groups plugin shortcodes to create ‘teaser’ pages that either

    1)show a snippet to logged in users not in the specific group or non logged in users
    or
    2)completely different text to those in the nominated group.

    This works fine for users logged and shows the page differently on the user group membership but displays nothing for casual browsers.

    I have been through the docs. What am i missing here…

    • kento February 27, 2015 at 10:00 am #

      Hi Chris, can you provide an example of how you have it set up currently please?

      • Chris March 2, 2015 at 6:33 am #

        Hi Kento

        Tracked the problem down to some random html tags embedded by the user somehow…

        Your product works just fine! :-)

  22. Kent March 3, 2015 at 12:23 am #

    I have installed the groups plugin. Set two different groups. I want to restrict retail buyers from viewing wholesale products. I set a whole sale product at the wholesale buyer restriction. bur the product still does not show up. I am using woocommerce for my products.

    • antonio March 3, 2015 at 11:23 am #

      Hi,
      you can send us dashboard admin acceso to support at itthinx dot com and we’ll have a look (please indicate this comment in the email).
      cheers

  23. EGFS March 4, 2015 at 9:40 pm #

    Is there a way that the ‘Groups’ plugin can restrict access to navigation menu items?

    • antonio March 5, 2015 at 6:37 am #

      Hi,
      please have a look to this conversation.
      thanks

      • EGFS March 5, 2015 at 11:07 pm #

        Thanks Antonio. That answered my question. It sounds like if the page has group restrictions assigned to it from Groups, then any Appearance > Menus items based on that page will also be restricted.

        • antonio March 6, 2015 at 8:58 am #

          Exactly, regards!

  24. EGFS March 6, 2015 at 2:47 am #

    I’m trying to Import users via a tab-separated TXT file using the ‘Groups Import Export’ extension. Upon clicking the button, the page displays the following error right away at the top of the page…

    Error on line 1, ajd@egbubs.net is not a valid email address.
    0 valid entries have been read.
    1 entry has been skipped.
    0 users have been imported.
    0 users have been updated.

    How is that not a valid email address? I’ve been using it for literally 7 years?! What’s going on here? Any help would be appreciated. Thanks.

  25. whoaloic March 6, 2015 at 9:57 am #

    Hello,
    I restricted posts to a group.
    I use categories widget to list categories included the number of posts that belong to each categories.
    For now, the number counts all posts of a categories and I would like to display the number of posts that group users are able to see.

    • antonio March 9, 2015 at 9:06 am #

      Hi,
      true, we will resolve it in future updates.
      Thanks!

  26. whoaloic March 6, 2015 at 10:03 am #

    I would like to override access to users with author role.
    Is that possible?
    Or should I include all capabilities for each author?

    • antonio March 9, 2015 at 9:14 am #

      Hi,
      you could:
      – create a group with a capability (e.g. ‘GroupA’ with capability ‘CapA’)
      – Assign this group to the authors (in Users list you have a bulk action above the table)
      – Then restrict posts/pages to this group.
      Regards

      • whoaloic March 9, 2015 at 10:44 am #

        Thank you antonio

      • whoaloic March 9, 2015 at 10:47 am #

        I created a new capability and I added this capability to my authors group.
        Thank you antonio.

        • whoaloic March 9, 2015 at 11:05 am #

          Just to be more clear: I have Group “Author” where I added all capabilities of others groups to allow authors to have full access.
          :)

  27. whoaloic March 6, 2015 at 10:22 am #

    I have custom post with custom fields.
    I would like to restrict visibility to custom fields. Is there a way to restrict visibility with the shortcode in template file?
    Cheers

    • antonio March 9, 2015 at 9:19 am #

      Hi,
      you can use something like this:
      $user_id = get_current_user_id();
      if ( $group = Groups_Group::read_by_name( 'Registered' ) ) { // if the Group exists
      if (Groups_User_Group::read( $user_id , $group->group_id )) { // if the user_id belongs to this group
      ....
      }
      }

      Also you have available the Groups API.
      cheers

      • whoaloic March 10, 2015 at 4:25 pm #

        Awesome thank you for your help I finally use:

        can( ‘premium’ )) : // if the user has the capability
        ?>

        • antonio March 11, 2015 at 8:03 am #

          perfect!

  28. Graham Ferguson March 6, 2015 at 12:55 pm #

    Apologies if this is covered but I cannot see this in the documentation. I would like to show ‘non-members’ only certain elements of a page e.g. intro but restrict further content of the same page to paying members. Is this possible via this plug in?

    Many Thanks

    • antonio March 6, 2015 at 5:54 pm #

      Hi Graham,
      you can use [groups_non_member] shortcode.
      Regards

      • Graham Ferguson March 9, 2015 at 4:57 pm #

        Thanks Antonio. What is the correct format when you need to specify multiple groups? I understand they should be comm separated but I can’t get that part to work.

        Thanks

  29. Iain March 7, 2015 at 9:41 am #

    can I keep search engine spiders and bots out of Groups protected cotent which I don’t want crawled and indexed…?

    thanks

    • kento March 8, 2015 at 8:23 pm #

      Hi Iain, they won’t even see the content if it is restricted.

  30. whoaloic March 9, 2015 at 8:30 am #

    Hello,
    I have a “archive-galeries.php” file.
    I set a menu item “Galeries” as a link (my-site/galeries) in my menu.
    All my post in my archive have restricted access to “Premium group”.
    But Galeries menu item is still visible.
    So when user in groups “Simple” click in the menu, they don’t see any post of this archive, but see “No article” string (that I set in my archive template).
    How to restrict menu item visibility to only “premium”?
    Cheers.

    • antonio March 9, 2015 at 9:22 am #

      Hi,
      please have a look to @kento comment.
      thanks!

      • whoaloic March 9, 2015 at 4:32 pm #

        Do you mean this piece of code?
        $result = false;
        require_once(ABSPATH . “wp-includes/pluggable.php”);
        if ( $group = Groups_Group::read_by_name( ‘Registered’ ) ) {
        $result = Groups_User_Group::read( get_current_user_id() , $group->group_id );
        }
        return $result;

        But where to put it to restrict visibility of a menu item?

        • antonio March 10, 2015 at 7:34 am #

          Sorry,
          with this code and using Menu Item Visibility Control plugin.

          • whoaloic March 10, 2015 at 4:40 pm #

            I’m sorry I don’t understand.
            I put this code in the menu item visibility field but get an error.

            • antonio March 11, 2015 at 8:06 am #

              true! You can use current_user_can('read');
              thanks

              • whoaloic March 11, 2015 at 4:52 pm #

                It works like a charm :)

                • antonio March 12, 2015 at 7:17 am #

                  Perfect!

  31. Graham Ferguson March 9, 2015 at 3:00 pm #

    Sorry if this has been answered before but I can’t see a manual or an easy way to search.

    My simple requirement is to restrict some content to only be visible to non registered users i.e. not a member of any group. I thought the following would work but it doesn’t:

    [groups_non_member]

    Call to join would go here

    [/groups_non_member]

    Any thoughts?

    • kento March 9, 2015 at 4:48 pm #

      Hi Graham,

      You need to specify the group – here’s an example:

      [groups_non_member group="Registered"]
      You're not logged in.
      [/groups_non_member]

      Cheers

  32. Frank March 11, 2015 at 11:58 am #

    We are a happy user of the Groups plugin.
    Now I would like to explore if I can take advantage of groups in combination with our https://wordpress.org/plugins/widget-logic/ plugin to restrict visibility of some widget to logged-in users.
    How would I use the API?
    Thanks,
    Frank

    • antonio March 12, 2015 at 7:16 am #

      Hi Frank,
      please have a look to this comment.
      thanks!

  33. EGFS March 13, 2015 at 1:31 pm #

    I am having difficulty with a sub-navigation menu showing up on our site. The sub-nav menu item is based on a post Category. Therefore there is no ‘page’ for this menu item and no place I can find to modify it’s permissions. The sub-nav shows up fine when logged in as admin, but I have Groups set to ‘Admins override…’. How can I go about have post Categories available in the sub-navigation menu?

    BTW, if I enter the address to the post Category page manually, the user is able to view the page fine. It just doesn’t show up as a menu item.

    Thanks for your help.

    • kento March 17, 2015 at 7:14 pm #

      Hi, you can add these as custom links, i.e. under Appearance > Menus > Links indicate the full URL and it won’t be “affected” by the access restrictions. I.e. you can add it as a Link indicating the full URL and set a link title accordingly, if you visit the link as an authorized user it will show up the content. Do you see what I mean?

  34. Ransom March 15, 2015 at 11:37 pm #

    Hi,
    Thanks for including a nice API documentation with your plugin.

    I’m trying to restrict access to posts so that only users with ALL the specified capabilities can access the page. Currently the plugin allows users who have ANY of the specified capabilities access a page.
    In other words, I need to restrict a page/post so that only users who are part of both GroupA and GroupB can see it.

    My use case is this: I need to restrict access based on groups which inherit capabilities, like employee, management, upper management. The plugin can do this great. But I also need to restrict further on location; users in the New York group need to see different content than users in California group. And users will always be in both one of the location-based groups and one of the employment-level groups.

    In the class-groups-post-access.php file, I see code which is commented out which would make the plugin behave in the manner specified above (just below the comment “The following is not correct in that it requires the user to have ALL capabilities:”
    The “user_can_read_post” function would also have to be slightly altered in order for it all to work right this way.

    Would it be possible for you to add an extra option or something (either globally or on a page-level basis), to require users to have ALL the specified capabilities in order to access a page, rather than require users to have ANY of the specified capabilities?

    If this jives with your vision of the plugin, I could even do the development.

    Thanks.

    • kento March 18, 2015 at 10:11 am #

      Hi,

      For this case I would recommend you to override the filter with your customized implementation. You would remove the posts_where that Groups adds and substitute it with your own.

      One important note here, if you are going to do that, you should know that the access restriction model is very likely going to change in Groups 2.x – a switch from access restrictions based on capabilities to access restrictions directly based on group memberships. For your case, I would assure that you have groups in place that can be mapped to the capabilities, once the new model is used, it will make it easier for you to keep your setup up-to-date.

      Cheers

  35. Rob March 16, 2015 at 3:52 pm #

    Hi – I currently have a site running with Groups and Groups for Woocommerce. I need to build a 2nd site on the same server and have managed to use the same database and also the same MySql user table so that user info is shared. I did this by adding the following to the wp-config file:
    $table_prefix = ‘subsiteprefix_';
    define(‘SHARED_USER_TABLE_ROLES_PREFIX’, ‘mainsiteprefix_’);
    define(‘CUSTOM_USER_TABLE’, ‘mainsiteprefix_users’);
    define(‘CUSTOM_USER_META_TABLE’, ‘mainsiteprefix_usermeta’);
    This, however, doesn’t bring across my groups settings and assigned capabilities – can you let me know if I can use this method to connect all the group capabilities, and, if so, which tables I need to include?
    Thanks for any help!

    • kento March 18, 2015 at 10:19 am #

      Hi Rob,

      I wouldn’t recommend it. The arquitecture of the system isn’t supporting this way of operation and I can imagine that you will find a lot of difficulties synchronizing things between the two sites.

      Would you mind explaining why exactly you need to have this second site using the data from the first one? Wouldn’t a multisite setup be more appropriate for what you intend to do?

      Cheers

  36. whoaloic March 18, 2015 at 5:11 pm #

    Hey!
    I have specific posts that i would like to restrict per user (not groups or capabilities).
    Is there any chance to succeed this feature?
    Best wishes

    • antonio March 18, 2015 at 6:14 pm #

      Hi,
      you can create a group and assign the user to this group (a group with only one member).
      Regards

  37. Marcus March 19, 2015 at 5:12 pm #

    I am using group plugin together with woo-commerce group extension.

    How can I make user who is not a member redirect to login instead?

  38. Marcus March 19, 2015 at 6:50 pm #

    I am able to use shortcode to show specific content to members and non-member. Thats working fine.

    I want to inform non member that this content is restricted and that they must buy or log in. In order to log in I am linking them to woo-commerce my-account page.

    I am not quite sure if this is the best way to do it.

    Is there any other way to show to non member login fields?

    And I have an other problem. I restricted a page which doesnt accept shortcodes. So I restricted it entirely with group plugin. That worked.

    But if user is not logged in the page tries to load and nothing appears. I would like them to redirect to login or displat some information. But as this page doesnt accept shortcodes I cant.

    Is there any other way?

    • antonio March 20, 2015 at 8:48 am #

      Hi,
      if you need to add the login form in a page, this post can help you.
      To redirect to another page Groups 404 Redirect plugin.
      Regards

  39. Wouter van der Zee March 20, 2015 at 1:11 pm #

    Hi!

    I’d tried to set up WooCommerce shop pages that are only visible for Customers. I used the default Registered group for that, created a Registered Capability, assigned it to the group and activated it in Options. Pages with Enforce read access ‘Registered (Registered)’ are now visible for normal Users but not for Customers. Is that somehow possible?

    Or is there a better way that automatically every registered WooCommerce Customer can view the shop pages (and non-users not). Hope you understand my question :).

    Thanks!

    • kento March 24, 2015 at 8:46 pm #

      Hi Wouter,

      The customers should also be able to see those pages if they are logged in. As a user account is created, the user would also belong to the Registered group which then opens up access to the pages.

      Cheers

  40. Rubén March 21, 2015 at 11:14 am #

    Good afternoon , first congratulations for the pluggin , is a very good tool. I had a doubt about the capabilities that each group , do you have a list detailing the meaning of each of the skills ? Could really know the meaning of each , I’m Spanish and taking a brief explanation would be interesting. Thanks in advance.

  41. Rubén March 22, 2015 at 6:26 pm #

    ok , when a version in Spanish ? ;)

    • antonio March 23, 2015 at 8:19 am #

      Hi Rubén,
      spanish version is available. When you install Groups, if your wordpress version is in spanish you’ll see Groups in spanish.
      cheers

  42. Rubén March 23, 2015 at 9:48 am #

    If correct , but many of the available opociones not explained in Spanish and I have to go about doing translations with google .

    • antonio March 23, 2015 at 10:31 am #

      We will review the admin translations for next update.
      Thanks!

  43. Matti March 24, 2015 at 8:15 am #

    I need to have a WP role for each user group to integrate the content restriction to other plugins which can only restrict access by roles. How can I do this?

    • kento March 24, 2015 at 1:55 pm #

      You can’t unless you create a specific solution for that. Is there anything in particular you’re missing from the access restrictions that Groups itself provides?

  44. Chris March 24, 2015 at 7:08 pm #

    How do I allow a user group access to only use a certain plugin?

    • antonio March 24, 2015 at 9:50 pm #

      Hi Chris,
      this feature is not available. You can use Groups API to create your own solution.
      Regards

  45. Rubén March 25, 2015 at 12:15 pm #

    Hi, I have a question . When I create a specific group discount the result for that group does what on me regular_price , the result should be on SALE_PRICE that is my final price . As I can do to not apply the discount on sale Price

    • kento March 25, 2015 at 12:22 pm #

      Hi Rubén, what plugin are you using for that?

  46. Rubén March 26, 2015 at 12:30 pm #

    Hello! I use the plugin is Group Pricing. The problem is that it makes me discount on Regular_Price , and must do so on the SALE_PRICE .

    • antonio March 26, 2015 at 3:39 pm #

      Hi Rubén,
      please ask to the plugin author website in eggemplo.com, I am happy to help you there.
      Thanks

  47. Rob Kinnear March 27, 2015 at 1:31 pm #

    Hi – I am having problems with the homepage of my site which keeps showing 404 page not found to non-member when I restrict access to it (fine without any restrictions). All other restricted pages are working fine (am using the Groups 404 redirect to send non-members to the wp-login.php). It seems to work when I redirect to a page or post but not the wp-login. Any ideas of what could be causing this?

    Thanks

    • kento March 27, 2015 at 10:42 pm #

      Hi Rob,

      What you describe sounds like it’s working as expected. If you restrict access to the home and are using the 404 redirect, it should avoid a redirect loop and thus come up with a 404 if you have it redirecting to the home page.

      Cheers

Leave a Reply