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

  • See all related Premium Extensions for Groups in our shop.
  • Groups Drip Content is used to release content on a schedule. Content dripping can be based on user account creation, group memberships and specific dates and times.
  • Groups Restrict Categories features access restrictions for categories, tags and other WordPress taxonomies, including support for custom post types and taxonomies.
  • Groups WooCommerce Sell Memberships with Groups and WooCommerce. Groups WooCommerce grants memberships based on products. It automatically assigns a customer to one or more groups based on the products ordered. Use any payment gateway that is supported by WooCommerce, including PayPal, Stripe and many others. Groups WooCommerce also integrates with WooCommerce Subscriptions for a highly flexible membership solution.
  • WooCommerce Group Coupons This extension for WooCommerce uses Groups and WordPress roles to limit the validity of coupons.
  • WooCommerce Product Search is the essential extension for every WooCommerce store. It provides the best Search Engine and Search Experience for WooCommerce and is compatible with Groups and its access restrictions on products.
  • Groups Import Export provides import and export facilities for Groups. Users can be imported and assigned to groups, users can be exported in bulk.
  • 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 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 Restrict Comments Pro This extension for Groups allows to restrict who can post or read comments based on a user’s group membership.
  • 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.

2,679 Responses to Groups

  1. BOUCHAIR April 3, 2014 at 3:36 pm #

    Hello,
    Is it possible to attach some users to a shop manager (woocommerce) and the shop manager can see only users attached it when he is logged in ?
    IF not, is there any plugin doing this ?
    Thank you

    • kento April 8, 2014 at 10:27 am #

      With Groups? I don’t think so, also what you refer to is a role, so you’d need something that allows to restrict stuff based on role and allow to establish a relationship between users.

  2. Andrew April 2, 2014 at 6:48 pm #

    I am trying to do some small scale access restrictions with just a few people and a few groups I am involved with. The trouble I am having is that comments written on posts which people have no access to, can be read in the comment widget by anyone. This isn’t the behaviour I would like – if a user can’t access a post/page, I’d like them to be unaware of the existance of it, and all of the context of it e.g. comments, tags, catagories etc… any mehtods of achieving this? They should see comments/tags/cats only relavent to content they can see…. surely?
    Thanks,
    Andrew.

  3. JessP April 2, 2014 at 2:38 pm #

    Groups for Woocommerce – how do I get links to all of the Pages that the members have access to on their account or a separate Membership page automatically? The Account and Membership page has the content:

    [groups_woocommerce_memberships]

    It is displaying their group only, not the link to the page/s that they have access to. Some of our clients will belong to a number of groups, how do I get the Plugin to display what they have access to on their Account/Memberships page?

    Thanks in advance for your advice.

  4. Loreen Liberty April 1, 2014 at 1:45 pm #

    I’ve been having some issues using NextGen Gallery – I know – not your plugin.

    However, by turning on then back off each of the plugins, I was able to find out which plugin is affecting NextGen…

    http://www.itthinx.com/plugins/groups/

    I use it as part of the membership management for WooCommerce.

    When I deactivate Groups – the NextGen Gallery menu in the dashboard header and sidebar goes away along with their attach to post button in posts/pages.

    When I reactivate Groups – the Gallery menu in the dasboard header and sidebar returns and the ATP button returns to posts/pages – but still opens blank. I can still create galleries / albums and add to posts/pages via the shortcodes. So I can at least use this as a workaround.

    Do you guys have any info on known conflicts with NextGen?

    • kento April 8, 2014 at 11:19 am #

      Hi Loreen,

      What versions are you using please? With the current latest versions on a test installation having Groups and NextGen active I can see both the Gallery menu in the admin sidebar as well as on top.

  5. Alex Vasquez March 31, 2014 at 4:38 pm #

    Hey there,
    I am using Woocommerce and WP 3.8.1 along with Groups so I can run memberships. I want to show content that members have access to. I’m creating a query to do this. The query works. It returns the pages that have the capability i assigned to that page. The problem is that it also returns other pages that I have not assigned that cap to. https://www.dropbox.com/s/wqgolj9bw20do91/Screenshot%202014-03-31%2009.33.52.png

    Here’s my query: https://gist.github.com/anonymous/9896420 – I don’t expect help with “code” I can put it together, I’m just lost as to why these other pages are returned. My code also sets to exclude the additional pages as well.

    Thanks.

    • kento April 7, 2014 at 9:49 pm #

      Hi Alex,

      What you describe is the expected behavior, you would have to filter based on the restriction capability as well to limit it to those only.

  6. Lance Cleveland March 31, 2014 at 12:35 pm #

    Thanks Antonio! I thought that might turn on the ability for users to select their own groups and was afraid to turn that on for 4,000 customer accounts.

  7. Lance Cleveland March 29, 2014 at 4:11 pm #

    Would be nice to have a “groups” section on the edit user page:
    /wp-admin/user-edit.php?user_id=2591

    Provide the same ability there to assign a user to a group.

    Why? I look for people by what they ordered in WooCommerce. Clicking on their name brings me to the edit user page. I then have to copy their UID, go to the users page, search, and then use the bulk actions for Groups to assign them to a group.

    It would be really nice to skip those extra steps. Putting the user bulk actions for groups right on the user edit page would be sweet!

    • antonio March 31, 2014 at 5:54 am #

      Hi,
      thanks for the feedback, but you can do it selecting “Show groups in user profiles.” in Groups->Options.
      cheers

  8. Rob Kinnear March 27, 2014 at 7:22 am #

    Hi
    Plugin set up and working well.
    Currently front end menu items for pages with access restrictions are hidden to users without access rights. This is great but doesn’t necessary help explain that the content is missing for a reason.

    My master plan is to add a padlock icon to highest level menu items that have hidden submenu pages.

    My question is whether there is any way I could make this happen using wordpress menu classes..?

    Example: all posts/pages within a photography section are restricted. The top level menu item is a custom item with a specific class that shows a padlock to non members and sub items are hidden (members don’t see padlock and sub menu items are shown as per normal plugin functionality)…

    • Rob Kinnear March 28, 2014 at 4:57 pm #

      I discovered how to do this myself in the end…

      Use the code found here: https://gist.github.com/nciske/5681384 in functions.php to allow short codes in menus

      I then used the short codes along with the font awesome icon set to create what I wanted – basically any restricted item shows a lock, once they have rtegistered it becomes and open lock as the submenu becomes available…

      \
      Menu link here [groups_non_member group="Registered"] closed icon here [/groups_non_member][groups_member group="Registered"] open icon here [/groups_member]
      \

      You can use the span tag to set font to fontawesome

    • kento April 1, 2014 at 10:26 pm #

      Hi Rob,

      It would be easy to do that using CSS rules based on the menu item which add the padlock as an icon.

  9. Renish Khunt March 22, 2014 at 9:30 am #

    Group is allow to subscribe user multiple times. i don’t want that. when user is subscribe one time then after user not subscribe again for that Group

    • kento March 24, 2014 at 11:54 pm #

      You can’t restrict that unless you apply some customized logic that disallows it based on existing group memberships.

  10. Renish Khunt March 22, 2014 at 5:58 am #

    Hello How can i get the End Date and Start Date Of user subscription Time.

    • kento March 24, 2014 at 11:53 pm #

      Hi, You’re working within what framework please?

  11. James Richard Banks March 21, 2014 at 2:08 am #

    Hi,

    Just wanted to see what is the best way a way to mass import existing users database to groups?

    Thanks,

    James

    • antonio March 21, 2014 at 7:39 am #

      Hi,
      in Users->All users you can use the “Groups Actions” to add the selected users to groups.
      cheers

  12. Caleb March 20, 2014 at 8:05 pm #

    Hi, I am trying to show a button on the WooCommerce “My Account” page to only Groups members. Here is the shortcode I used:
    [groups_member group="Shopper"]
    [button link="http://www.atlantapetstopdogfence.com/store-atlanta/" color="red" size="large" target="_self" title="" animation_type="fade" animation_direction="down" animation_speed="0.5"]Click Here to Shop[/button]
    [/groups_member]

    However, that is not working! How can I show a button to groups members only on my WooComemrce “My Account” page?

    Thanks!

    • antonio March 21, 2014 at 7:50 am #

      Hi,
      This code must work fine. Please give us a url to have a look.
      cheers

      • Caleb March 21, 2014 at 7:57 pm #

        Hi, here is the link to the page I have that shortcode on: http://www.atlantapetstopdogfence.com/my-account/

        Thanks for the help!

      • Caleb March 26, 2014 at 2:28 am #

        Hi, have you figured anything out with this problem?

        • antonio March 26, 2014 at 7:18 am #

          Hi,
          please approve my account ( eggemplo at gmail dot com )
          cheers

          • Caleb March 31, 2014 at 3:52 pm #

            I do not see you pending for approval. How would that help anyway? Don’t you need Admin/FTP access?

            One of the other admin’s of that site might have denied you access. If you need to go through the registration process, please do so again and I will approve you.

            If you need access to admin/ftp – what email can I send that info to?

            Thanks!

          • Caleb April 8, 2014 at 2:38 am #

            Hi, did you receive my reply? I have been waiting a long time. If you did not get my reply here it is:

            I do not see you pending for approval. How would that help anyway? Don’t you need Admin/FTP access?
            One of the other admin’s of that site might have denied you access. If you need to go through the registration process, please do so again and I will approve you.
            If you need access to admin/ftp – what email can I send that info to?

            • kento April 8, 2014 at 8:52 am #

              He asked you to approve the account eggemplo, when trying to log in it still says “ERROR: Your account is still pending approval.”

          • Caleb April 8, 2014 at 3:21 pm #

            Okay, the account eggemplo has been approved. Sorry for the confusion – and thanks for the help!

            • antonio April 9, 2014 at 3:43 pm #

              Hi,
              sorry right now I can login with this account “username is not valid”, please send us an user login data to support at itthinx dot com.
              cheers

  13. Kat March 20, 2014 at 6:03 pm #

    HI,
    I’ve recently downloaded the Groups plugin and have a question about customer movement between groups. I don’t see how a customer moves automatically from one group to another through upgrading their purchase. For example customer A registers for a free product and goes into the basic group. The customer then decides to upgrade to the next level. The purchase doesn’t move them into the next level group.

    I’m most likely just missing something here and was hoping you could help.

    Thanks!

    • antonio March 24, 2014 at 3:35 pm #

      Hi,
      What shopping cart are you using?

  14. arnaud sprimont March 20, 2014 at 5:00 pm #

    Hello thanks a lot for this great plugin !

    I try to run a function when a user join a group is this a way for this
    and a other hhen a user quit this group

    is a user join group (‘a’)
    then
    get the user id and change a info about this user

    the goal is to put this function in function.php

    See you Soon

    Arnaud

  15. Romain March 20, 2014 at 8:47 am #

    Hi,
    I’d like to know if with the groups plugin or an other that come with it (free or not) that can set an expiration date on a member (or a group).
    Like group_1 can login until 2014/08/01 or group_1 can login for the next 3 month.
    Thanks.

  16. Akhil March 17, 2014 at 10:54 pm #

    The Groups 1.4.9 update has no changelog associated…?

    • kento March 17, 2014 at 11:15 pm #

      It does, it’s in the readme.txt

  17. Hugh March 17, 2014 at 6:50 am #

    Hi there!

    I’m wondering if there is any way to either

    – set a default group for all new users to be added to or…
    – add to a group when creating a new user account (rather than having to go to the users page and add to a group as a separate step)

    Any help would be greatly appreciated!

    • antonio March 17, 2014 at 8:09 am #

      Hi,
      you can use this function (add this code in your functions.php theme’s file).
      cheers

  18. Roberto March 12, 2014 at 11:16 am #

    Hi!!

    I’m watching your product here http://www.woothemes.com/products/groups-woocommerce/ and I have a question.

    Sorry for my bad english but, if I’ve understand with this plugin is like if I sell capability? with your plugin the customer can buy the right to be in one or more groups using woocommerce?

    Thanks!!

    • antonio March 13, 2014 at 7:45 am #

      Hi, exactly does that.
      cheers

  19. Lance March 10, 2014 at 7:47 pm #

    Good day,

    I am the Web Site Admin Officer for Air Cadet Sqn in Canada. I would like to take the sqn’s word press site and turn it into a membership site that has front-end and back-end functionality with the following features:

    Registration Form (Name, Rank, Position) (Front-end);

    – Login (Separate from WP Login) (Front-end);

    – Add registered cadets to User Groups (ie: Sqn Staff, Drill Team, Flights, Cadet Classes) AND

    – Display List of Members (w/Name, Rank, Position) for each user groups for viewing by registered cadets and officers can view lists (front-end);

    – Officers and Staff Cadets can send out mass e-mails to user groups (front-end).

    I am not sure if the wp plugin/software has the above features. If not could please let me know what other options are available. Thanks

    Lance Benns
    benns at rogers dot com
    132 Spitfire Air Cadet Sqn
    http://132spitfiresqn.ca/

    • kento March 11, 2014 at 1:01 pm #

      Hi Lance,

      I would recommend to first try to set up the different groups and use the shortcodes to display the information as you have outlined, based on group membership etc. This can be done with Groups itself without the need to use any extension.

      Communicating with user groups can be done using the Groups Newsletters extension, i.e. it would be one option for the mass emails you have mentioned. I’d recommend to take a good look at the documentation first so you get an idea how that works. http://www.itthinx.com/documentation/groups-newsletters/

      Cheers

  20. Caleb February 26, 2014 at 6:45 pm #

    Hi,
    I have a problem. I restricted a page to a certain group. When I am logged out I shouldn’t be able to access that page. The problem is, if I type the link in to my browser (while I am logged out) and go to that page I can see it – no 404 error or anything like that.

    The weird thing is, that page is in the menu and when I am logged out, I can’t see it in the menu. So that part is working.

    I just need that page to show a 404 page when a user tries to access it via a link somewhere else.

    Thanks!

    • antonio February 27, 2014 at 9:09 am #

      Hi,
      How you are restricting access to the page? By using the shortcodes or restrict access?. Please give us your code (if you are using shortcode), or the capabilities used in access restrictions box.
      Give us an url to have a look.
      cheers

      • Caleb March 3, 2014 at 9:47 pm #

        Hi,
        I am using the restrict access. The capability that I gave the group is “groups_read_post”. Then I went to the page I want to restrict and checked that group for restrict access.

        Now, the restriction works in the menu, but you can go to this link (http://www.atlantapetstopdogfence.com/store-atlanta/) and view the page without logging in.

        Thanks for your help!

        • kento March 4, 2014 at 9:05 am #

          Hi Caleb,

          Looks like you want to hide the WooCommerce shop page 😉

          • temmes March 25, 2014 at 10:33 pm #

            I think I have the same issue.

            A. I use Buddypress. When I want the Members page to be hidden for non-members the menu item is not displaying but when I use the url of that page the page shows up even when I am not logged in. Restriction is set to “groups_read_post”

            B. When I use another page with some content and I use the same restriction the menu does not show either and when I use the url it gives a 404.

            So does the restriction not work on certain pages?
            Can de redirection page be something else than 404? Lets say the Registration page.

            • kento March 26, 2014 at 11:27 am #

              A : Do you have caching enabled for logged in users? That may be an issue. If yes, please try to turn it off and check if the page restriction is in place correctly.

              B : The Groups 404 Redirect plugin will help with that (can be installed from the Dashboard directly).

  21. Kelly February 26, 2014 at 3:29 am #

    We are using 2014 Groups, WooCommerce Groups, and Groups Restrict Categories with WooTheme’s Sensei Learning Management System to sell online courses.

    We want to “drip” content (e.g., not “viewable” before week 2). Sensei does not have that feature. The WooCommerce Groups purchase puts learner into group(s) or removes them from group(s)at checkout. So cannot drip content that way.

    Membership plugin based on wp user roles (capabilities)can drip content, but is not integrated with WooCommerce.

    Any ideas how we can merge a Group (Platinum) Group Capability (platinum) with a wp user role Platinum Student with a user role capability (platinum)?

    We use Formidable Pro. Wish you had Group integration for Formidable (like your integrations with Gravity Forms).

    • kento February 26, 2014 at 2:31 pm #

      By ‘drip’, I understand you mean to make content available to users after a certain time, on a per-customer basis and related to when they have purchased a product. Rather than this being related to a group membership, I’d say it would make sense to be able to restrict the visibility of a post based on the age of a user account or related to a product purchase. Well, although I suppose it would also make sense to base it on when a user joined a group …

      Regarding the group-role merge, you can filter the user list by role and just bulk-assign users to the group.

      I can’t really say much about a possible integration with Formidable Pro, unless someone were to sponsor its development, for now I don’t see it happening.

  22. David February 25, 2014 at 2:39 pm #

    I would love to see a notification extension here. Not so much a newsletter or notification when users leave/join, but notifications via email when new content is published to the group. This would avoid using categories to manage this functionality and rely on groups instead. Only members of a particular group (or parent group) would receive the notification. It would also be great to have a checkbox at the bottom of a post to disable the notify as needed. If I end up writing this, I’ll post it here. If it already exists, thanks for sharing! 🙂

    • kento February 25, 2014 at 4:48 pm #

      Thanks for the suggestion David. I’ve thought about that and I think we had someone suggesting this earlier, the thing is that there is more to it than just the plain notification. It’s about whether people agree to get those notifications, to let them subscribe and revoke their subscription, to handle the emails that are sent out correctly (think about thousands of subscribers) etc. Among the reasons why I wrote Groups Newsletters was that I wanted to provide a flexible solution that would take all that into account.

      • David February 25, 2014 at 5:31 pm #

        Thanks for the reply, makes sense. GN is a little heavy for what we’re trying to do but would it account for automated blasts when new content is published? It seems more centered around campaigns.

        • kento February 25, 2014 at 6:02 pm #

          The thing about automated notifications when content is published is that these are easily interpreted as spammy when the frequency with which you publish content is substantial. And taking into account that automating it would be motivated by the fact that you do have a lot of content published, you’ll end up being flagged as a spammer without the intention of being one. The good thing about the campaigns is that it allows you to selectively target your audience with one or more meaningful newsletters that present information to relevant groups, and makes it more likely for them to actually read the content of those and end up visiting your site.

          If it’s really just subscribing to posts, I think using something like Subscribe to Comments Reloaded makes much more sense, as it allows to subscribe to content without having to comment and the user still consents to it explicitly.

          • David February 25, 2014 at 7:24 pm #

            Its actually subscribing to categories, or in this case groups. The idea wouldn’t be to notify all users when new content is added, but notify users of a particular category (or group) when content is created in that group. These would all be internal registered users of the system who need to see posts as they happen. Of course theres many ways to go about it. An “email notify” option inside the group would be one of them, even if its on the user to subscribe. I would have to disagree thats spammy.

            • kento February 26, 2014 at 10:09 am #

              Do you have large sets of users in these groups? And how do you relate the posts to groups?

  23. Jason February 23, 2014 at 6:16 am #

    Adding user access restriction based on the box showing up on the post editing page, ONLY hides the content, not the title. This was not the case with the previous version of this plugin. How do I address/modify to handle this?

    To accomplish this i’m using current_user_can(MyCustomCapability) to hide/show posts, it’s working for the post excerpt but not the title.

    Your insights are appreciated.

    • kento February 23, 2014 at 11:35 am #

      What are you using to display the titles please?

      • Jason February 23, 2014 at 7:48 pm #

        I’m using the following bit of code to show the last 3 posts. This code is embedded in a page template. With the previous version of the Groups Plugin, this worked as expected — I was getting the last 3 posts that the user had rights to view. The issue I’m experiencing is that now I’m simply getting the last 3 titles for ALL posts, and excerpts for any posts the user has permissions to view:

        3, ‘category’ => 22 );
        $myposts = get_posts( $args );
        foreach( $myposts as $post ) : setup_postdata($post); ?>

        <a href="”>

        3, ‘category’ => 22 );
        $myposts = get_posts( $args );
        foreach( $myposts as $post ) : setup_postdata($post); ?>

        <a href="”>

        • Jason February 23, 2014 at 7:49 pm #

          Sorry, I can’t seem to figure out how to paste you my code. Please advise how I get you my code.

          • antonio February 24, 2014 at 6:28 am #

            You can use pastebin.com
            cheers

            • Jason February 24, 2014 at 2:14 pm #

              Here you go, in pastebin:

              http://pastebin.com/BzHUGEm0

              • Jason February 25, 2014 at 5:02 pm #

                Any thoughts on this?

                • kento February 25, 2014 at 6:11 pm #

                  You have if ( current_user_can('Market')) … – what’s Market please? If it’s supposed to be a group, then the approach is wrong within Groups’ concepts (see Examples on how to check for group membership).

                  If your posts are restricted, then it makes sense that the excerpts aren’t shown but the titles are, because we’re not filtering on the_title (which maybe we should? Hmmm …)

                  • Jason February 25, 2014 at 6:16 pm #

                    Market is a Capability (it is also independently the name of a group). In this case, and as previously implemented current_user_can(‘insert capability here’) was used to filter based on the users access to said capability.

                    These questions have arisen as a result of updating from a previous version of Groups. I’m assuming these API changes were part of that.

                    I’ve figured out how to filter ‘the_title’ (by mirroring what’s been done with ‘the_content’) again — the way the plugin previously worked, it simply omitted any posts entirely, where the user did not have the capabilities, allowing different membership levels, different blog-experiences based on their capabilities.

                    I understand that this stuff changes for sure, to make the plugin better. I get that.

                    My follow-up question would be: the premium plugin for Groups Categories: Would this hide the entire post????

                    • kento February 26, 2014 at 10:04 am #

                      Ok, I think if you simply filter the title it would be ok for your case. Using Groups Restrict Categories wouldn’t make a difference.

                    • Jason February 26, 2014 at 2:17 pm #

                      No completely ok, it does simply just hide the title to filter it using repetitive code (based on the_content).

                      So if I show you the last 3 posts, and you have access to 2 of them, you see two and the third is blank.

                      Again this is a bit frustrating, as this worked just fine, until the latest update. So I’m a bit stumped as how I should address.

                    • Jason February 26, 2014 at 2:17 pm #

                      So if I show you the last 3 posts, and you have access to 2 of them, you see two and the third is blank.

                      Instead, as it did previously: I’d like to simply show the last 3 posts you have access to, skip anything you don’t.

                      Thanks!

                    • kento February 26, 2014 at 2:37 pm #

                      Ok now I’m confused 😀 More coffee!

                      Do you mean that once you’ve added a the_title filter which checks the same as Groups’ the_content filter does, you still get to see the title of a post even though you shouldn’t?

                    • Jason February 26, 2014 at 3:53 pm #

                      I guess to simplify what I’m trying to do, and basing it solely on how the website worked, pre-update.

                      What I’m trying to do is make those posts the user is not supposed to access, completely invisible to the user. Not showing up in the blog roll (as either a title or a post), or the “next/previous” links at the bottom of each single post.

                      Simply put: if you’re not a member of the “Silver” group — then you don’t get Silver posts. If you’re not a member of the “Gold” group you don’t get “Gold” posts.

                      This all worked flawlessly before — which is stemming my confusion and frustrations.

                      Your help is, as always, appreciated.

                    • kento February 27, 2014 at 5:58 pm #

                      Hi Jason, thanks for explaining that. I’d say it’s easy then, please have a look at the Foobar group example here, if you use that in your template it should give you the expected results. One thing though, the query used to obtain the posts doesn’t contain posts that the current user doesn’t have access to. If you’re adding additional restrictions on top of that, then using the API like shown in the example should make it consistent.

                    • Jason February 27, 2014 at 8:35 pm #

                      “One thing though, the query used to obtain the posts doesn’t contain posts that the current user doesn’t have access to.”

                      If I understand that correctly: then we shouldn’t have “holes” in the blog roll when loop runs through posts that are not available to that user based on permissions, correct?

                    • kento March 3, 2014 at 5:03 pm #

                      That depends on how you are managing the restrictions, but as long as you’re using groups it should effectively reflect what visible based on the capabilities and group memberships.

  24. Moonworks February 21, 2014 at 10:36 am #

    Hi 🙂

    I’m trying to figure out the way it works when allowing only those with certain capabilities to view a page.

    When I create a new page, I see the section at the top right, but that only seems to allow me to select ‘groups_read_post’ as the capability.

    I have created several capabilities of my own as we need four of them for each form we have, and we have several forms.

    For example, a capability we have created is ‘cpb_duplicate-guestpost’, which is given tothose who are automatcally joined to the ‘duplicate-guestpost’ group.

    What I’d like to do, is have only those with this capability to view the page reserved for those people who signed up on the ‘Duplicate’ book tour to run a guest post on their site.

    I know I could use shortcodes, but I’m using the Visual Composer plugin, and that doesn’t allow shortcodes surrounding its own shortcodes.

    Is there a way to do this that I’m missing?

    Thanks,

    Joe

    • antonio February 21, 2014 at 3:15 pm #

      Hi,
      in Groups->Options you must add the capabilities that will be offered to restrict access to posts.
      cheers

      • Moonworks February 21, 2014 at 3:37 pm #

        Thanks, that did the trick.

        One last question. Is there a way of showing a message on the page for those without the capability, instead of it showing as a 404 page?

        • antonio February 21, 2014 at 5:13 pm #

          Hi,
          usually done with shortcodes.
          Since you can not use shortcodes, you can create a page and use Groups 404 Redirect plugin.
          cheers

          • Moonworks February 22, 2014 at 1:20 pm #

            Thank you 🙂

  25. Caleb February 20, 2014 at 9:26 pm #

    Hi, How can I show a page to non-members but hide that page from members.

    Example: I have a “Register to Access Site” page. I want non-members to see that page so they can register, but once a user registers I don’t want the new member to see that page anymore.

    How can I accomplish this?

    Thanks!

  26. Nigel Yoshida February 19, 2014 at 1:27 am #

    Hello, our organization has “Chapters” that our users can join. Each chapter has a “Queen” which is basically an organizer of that chapter. I would like to know if your plugin can accommodate someone being an organizer of a group and allow that organizer to be the person to modify and grant access to her group. Also, I was wondering if your plugin could accommodate a group page that has information about that group that is editable by that group organizer, much like Meetup.com.

    Thanks in advance.

    • kento February 20, 2014 at 11:20 am #

      Hi Nigel,

      The access permissions OOTB are too coarse to allow doing that, well at least currently. But the idea of allowing group-based access to the plugin’s administrative functions is of course very sensible, so although you can’t really do what you describe with it right now, I’ll take it as a great feature suggestion.

  27. Lyndsey February 17, 2014 at 11:59 am #

    Hi I’ve seen Mark Simpsons post on how to show a list of posts, available to the user.

    I’ve looked at the documentation, but wondered if you could show an example?

    • Lyndsey February 17, 2014 at 12:21 pm #

      Further to the above, how would I show a list of pages that the user cannot read, taster excerpts so to speak?

      • antonio February 18, 2014 at 9:26 am #

        Hi,
        added [groups_list_private_posts] shortcode in Groups Utilities functions on github.
        cheers

    • antonio February 18, 2014 at 9:00 am #

      Hi,
      you can use this code as reference (this is not a plugin, you must copy in your functions.php file, ans use the [groups-list_posts] shortcode).
      cheers

  28. Lisa February 16, 2014 at 3:32 am #

    I’m sure there’s a way, (maybe with groups_admin_groups), but I dont know.

    I’d like the administrators to have access to all groups (or content restricted by groups) by default even if they’re not added to the newly created groups.

    Please advise…

    Love the plugin!

    • antonio February 19, 2014 at 3:23 pm #

      Hi,
      in Groups->Options you must select “Administrators override all access permissions derived from Groups capabilities.”
      cheers

  29. Natalya February 15, 2014 at 6:49 pm #

    Hi,

    I want the links to my restricted content to be visible in the navigation for everyone so that when the user clicks on these pages they get redirected to a page that prompts them to buy the membership to view the restricted content. Currently with the Groups plugin the restricted pages disappear from the navigation for unrestricted users all together. How do i set up the plugin to work they way i need it?
    Thanks

    • kento February 20, 2014 at 11:05 am #

      Hi Natalya, you could place custom links in your navigation and use Groups 404 Redirect to point them to a page inviting to join as members.

  30. Dennon February 14, 2014 at 11:47 pm #

    Great plugin.

    I had a quick question: I’m using Woocommerce and have already set the Shop page so that you have to login to view the shop itself. I did this in archive-product.php.

    Is there an easy way to do the same thing and make it so that Groups automatically makes it so you have to be logged in to view any woocommerce product? I’ve already added a couple hundred products, and I don’t want to have to go back one-by-one to change access.

    And ideas?

    • kento February 20, 2014 at 10:58 am #

      Yes, there’s a new plugin about to be released Groups Restrict Categories which allows to restrict access to categories in general, including the posts that are in them.

  31. Karen February 13, 2014 at 8:58 pm #

    Hi again

    Sorry I’m very new to WooCommerce and didn’t realise that I had to manually complete every order!

    Thanks
    Karen

    • kento February 14, 2014 at 10:09 am #

      Hi Karen,

      There is an option under WooCommerce > Groups that you can use “Add users to or remove from groups …” – set that to Processing it will save you the effort of manually completing the orders.

      Cheers

  32. Karen February 13, 2014 at 4:15 pm #

    Hi

    Customer bought a group subscription on Tuesday and they still haven’t been added to the groups.

    The product is linked to ‘subscriber’ and ‘members’

    However the user’s group status reads as follows:

    Group Memberships
    Registered membership.

    Group Subscriptions
    No subscriptions.

    Do you have any suggestions please?

    Thanks
    Karen

  33. albert February 13, 2014 at 9:45 am #

    Hi,
    I’m using your plugin but I don’t know how do a thing:
    I create this groups:
    -A
    –B
    –C

    ‘B group’ and ‘C group’ are children from ‘A group’, so I can make this:
    ->Asign users to group B or C directly, they are in group A? Because in page make this “rule”:
    ———————————————————————–
    [groups_non_member group="A"]You can’t see this content.[/groups_non_member]

    [groups_member group="A"]Welcome [/groups_member]

    [groups_member group="B"]member of group B.[/groups_member]

    [groups_member group="C"]member of group C.[/groups_member]
    ———————————————————————–

    Can or not this.

    • kento February 13, 2014 at 12:17 pm #

      Hi Albert, the shortcode doesn’t check the inheritance, so you would rather do it this way:

      [groups_non_member group="A,B,C"]You can’t see this…[/groups_non_member]
      [groups_member group="A"]Welcome,
      You’re in these groups: [groups_user_groups]
      [/groups_member]

  34. bigbossfr February 1, 2014 at 9:08 pm #

    Hi,
    Since some weeks, users on my website are not added by default to Registered group.
    I use this code :

    $password = wp_generate_password( $length=12, $include_standard_special_chars=false );
    $user_id = wp_create_user( $username, $password, $email );
    $user = new WP_User( $user_id );
    $user->set_role( ‘subscriber’ );

    And after :
    Groups_User_Group::create( array( ‘user_id’ => $user_id, ‘group_id’ => 4) )
    ( 4 is my group)

    But users are not added in any groups.
    Before is worked, so i do not think my code is wrong ^^.

    If i add an user manually in my admin website, users are added to the Registered group.

    Thank you.

    • bigbossfr February 1, 2014 at 11:00 pm #

      I have tried to debug :
      When we create a user with the function wp_create_user(), is_user_member_of_blog return nothing or is false.

      • bigbossfr February 1, 2014 at 11:26 pm #

        Perhaps the problem is because i use W3 cache and cloudflare ?

        • bigbossfr February 2, 2014 at 12:28 am #

          Fixed
          I have to disable the database cache of W3 cache.

          • antonio February 3, 2014 at 7:06 am #

            perfect 😉

  35. Clayton January 31, 2014 at 7:54 pm #

    I saw the comment above about viewing instead of downloading. It wasn’t clear to me, so wanted to clarify – is there a way to view a protected pdf or jpg file in the browser instead of forcing a download?

  36. Masayuki January 27, 2014 at 3:41 pm #

    I wrote a question in another post the other day, but the example of Eric was very close to my situation, and will post again here.(http://www.itthinx.com/plugins/groups/#comment-313102)

    I am using Groups, Groups WooCommerce, Affiliates Enterprise and WooCommerce Subscription.

    I want to know how to set a specific product is not shown to the premium group.

    My client has product for Non-registered customers.(ex.Product A)
    And also, client has product for Premium group members.(ex.Product B)
    The customer attribute will promote to a Premium member when the Non-registered customer buys product A.

    Non-registered customer can see Product A.
    Group member can not see Product A.

    Group member can see Product B.
    Non-registered customer can not see Product B.

    Case 2 is easy to setup using “groups_read_post” capability.
    But I could not set Case 1.

    Please help!

  37. Alley January 22, 2014 at 10:31 am #

    I’m using groups with woocommerce and I’ve found a bug that I just cannot fix – it’s driving me nuts.

    When I activate the groups plugin, the product notes written for each specific product are lost, they are not emailed to the customer. All other details are sent email, but not the product notes, and they’re crucial.

    When I deactivate the groups plugin – product notes are displayed in the emails. I’ve tested this on 2 websites, same issues arises.

    Somewhere there is a conflict – would you know how to resolve this?

    MORE INFO: This happens regardless if a product has been assigned to a group or not. The second website I was just for testing – I made one product, tested the email. Then activated the groups plugin – made no adjustments and tested again = failed, no product notes in email.

    Please help.

    • Alley January 23, 2014 at 5:28 am #

      *correction.

      I meant to say – purchase notes (NOT product notes)

    • antonio January 24, 2014 at 10:17 am #

      Hi,
      That should not happen. You can send us your test website dashboard admin access to support at itthinx dot com (please indicate this comment in the email).
      cheers

  38. Arvid January 18, 2014 at 10:43 am #

    I use groups to regulate control who can see which pages among other features as well. Though coupon works fine, the page access is not as we would like to see. It could be that we are doing something wrong or that we have to put an extra code somewhere. What we do is the following:

    In our webshop we do special requests. Those are special orders which are only for specific clients. We put them in a sepearte category in woocommerce. In the product we create an access restriction and configure the correct group and capability. If we give the customer the direct link the customer can see the product page, other users (like our test dummy who is not having the right rights) can’t access the product page even with the direct link. So the access restriction works fine. But the customer can’t see the products through accessing the special request page. The page will open, but no products are shown. Any ideas?

    • kento January 18, 2014 at 10:58 am #

      Hi Arvid,

      On the special requests page, how are the products retrieved? Is it done at the right point, i.e. when the user object is initialized and the access restrictions can be checked correctly by the system?

      • Arvid January 18, 2014 at 11:10 am #

        I did a check and recheck. But could you provide me with the link of the page you mentioned so I can check it again?

        • kento January 20, 2014 at 10:20 am #

          I don’t have a link for the page, I was referring to the one you mentioned 🙂

          • Arvid January 20, 2014 at 10:50 am #

            Another client or an anonymous client is not even seeing the “special request” in the menu. Only clients who have the the rights of the special request products see “Special request” in their menu. But clicking on this category, they don’t see any product items.

            But if we provide them with the direct links, they can see the items though. And if I try with an anonymous account to open up this same direct link, this anonymous client can’t open the page. So the product is correctly configured with the right access rights if I am correct. Otherwise they wouldn’t be able to see the product in the first place. But why isn’t it showing up in the category page? They do have the rights.

          • Arvid January 21, 2014 at 1:27 pm #

            Hi Kento,

            I did some flushes on the page and can say that it works perfectly. Thank you for your repsonses

            • kento January 21, 2014 at 2:14 pm #

              Thanks for the update, I was just reading through your previous comment thinking about what could be the cause 🙂 By flushing you mean you had to clear the cache? Which caching plugin are you using please? Would be good to know if someone else stumbles upon this.

          • Arvid January 22, 2014 at 7:55 am #

            I too couldn’t figure out why it wouldn’t work as everything looked as it was configured the right way. And it turned out it was.

            The caching plugin I use is W3 Total Cache

  39. Eric January 13, 2014 at 4:30 pm #

    I have a site where I sell retail and wholesale products. I want to hide products from “wholesale buyer” buyer group but have them visible to non-registered users who don’t belong to any group. Can’t get it to work. Help?

    • kento January 18, 2014 at 10:29 am #

      Hi Eric,

      You could use an approach as implemented in Groups_Post_Access to check if the viewer belongs to the group. Pretty much the inverse case of what that class does for restricted posts. We’ve been discussing using logical operators for the capabilities previously, but it hasn’t been implemented yet.

      • Eric January 20, 2014 at 6:28 am #

        Thanks. I appreciate your help. However, I don’t really know what I’m doing enough to make use of what you’re telling me.

        • kento January 20, 2014 at 10:22 am #

          Ok I see, this would be something a developer would be able to help you with. The link I mentioned would be something that a customized solution for your case could be built upon.

  40. Richard Tandoh January 9, 2014 at 11:07 am #

    Antonio

    I emailed my site URL and admin log on details to itthinx at itthinx dot com yesterday. I hope you got them. I would really appreciate your help with this, as it is holding up my site launch.

    Thanks.

    rt.

    • antonio January 9, 2014 at 6:53 pm #

      Hi,
      I have send you an mail from support at itthinx dot com.
      cheers

  41. JessP January 8, 2014 at 10:17 pm #

    Hello. I have just had a quick scan through comments and could not find the answer to this question…

    Is your Plugin able to execute Login restriction by IP Address – If the number of login attempts from different IP addresses exceed the specified limit then the member’s account will be locked?

    Also… does it have the ability to disable simultaneous member logins using the same member account details (two users cannot log-in to the same account at the same time). Helpful when you want to prevent member login sharing.

    Kind regards,

    Jess

    • kento January 10, 2014 at 5:56 pm #

      Hi Jess,

      Groups doesn’t provide these restrictions as it focuses on memberships, not login restrictions based on IPs.

  42. Richard January 8, 2014 at 1:43 am #

    Hi

    I created a capability called premium (http://d.pr/i/Rzic), assigned it to a group called Premium (http://d.pr/i/WeYF) and then set it to enforce read access on posts (http://d.pr/i/zGZX).

    I then added the premium capability to the Enforce read access field of a post to hide it from non-members of the Premium group and it worked. I then did the same with a page and it didn’t work. Strangely, using the [groups_member] shortcode to protect the content of the same page, did work.

    I’m confused. Do I have to do something more to protect entire pages using the Enforce read access field?

    FYI I am using Groups (1.4.6), Groups 404 Redirect (1.1.2), WooCommerce (2.0.20), Groups WooCommerce (1.5.2) and WooCommerce Subscriptions (1.4.5).

    Thanks,
    rt.

    • antonio January 8, 2014 at 10:24 am #

      Hi,
      your setting seems correct.
      Please give us an url to have a look.
      cheers

  43. Imperative Ideas January 8, 2014 at 1:39 am #

    Hey Kento,

    I’m looking for a way to allow moderators from within the community to manage their own group pages, from memberships to forums. Presently, everything has to be done by WP site admins, which doesn’t scale very well. I’d love to be able to approve a new topic/group, assign control to the registrar(s), and let them be off to the races.

    Does this capability exist? If not, I’d love to figure out the best way to add it – but I’m not even remotely familiar with your codebase as of yet.

    BuddyPress is bloated, Symposium looks like it was written during the .com boom and not post-Facebook. I’m hoping Groups can be the modular solution that allows for targeted social/group activity on a WordPress platform.

    • kento January 9, 2014 at 10:32 am #

      Hi Ian,

      Regarding this

      “… to be able to approve a new topic/group, assign control to the registrar(s), and let them be off to the races.”

      Can you give a brief but full use case description of how that process would look like please? The Groups Forums plugin allows to set up a Topic Moderators group but I think that what you’re looking for requires a more fine-grained approach. Also this would only hold for moderating topics handled by the plugin, not any post or custom post type. I’ve given an equivalent example of the capabilities for a Pizza CPT here … in case that helps with the idea.

  44. James January 7, 2014 at 5:08 am #

    I’m having trouble configuring a private product for purchase using WooCommerce and Groups (latest).

    Admin can view the product and add to cart.
    Registered members can view the product, but CANNOT add to cart (no add button visible).

    I’ve tried setting the user’s role to both Subscriber and Customer (made no difference)

    the Groups for the particular user are “Registered” and “Premium”
    On the product page, Enforce Read Access -> “premium (Premium)”, Status = Privately Published
    The Group “Premium” has -> read_product
    read_private_products
    edit_shop_order
    read_shop_order
    edit_shop_orders
    publish_shop_orders
    read_private_shop_orders
    edit_private_shop_orders
    premium

    Any ideas? I wasn’t sure what capabilities to add for Group “Premium”

    • kento January 10, 2014 at 5:49 pm #

      Hi James,

      You would rather configure this without the status set to private and instead just use the premium capability to restrict access to the product (the Premium group should have that capability assigned).

  45. Ben January 6, 2014 at 10:09 pm #

    WordPress 3.8 and Groups 1.4.5.

    • kento January 10, 2014 at 6:16 pm #

      Thanks Ben,

      It’s odd that this error comes up on your site, pre 1.3.8 Groups didn’t check if the new function wp_cache_switch_to_blog exists and would use the wp_cache_reset function which is deprecated since WordPress 3.5.0.

      Also testing on WordPress 3.8 and the latest Groups 1.4.6 doesn’t bring up any error, not when creating nor when deleting a site from the network admin.

      I can’t really say what’s happening on your site, but would recommend the usual approach of making a replica of the site for tests where you keep only the essential plugins activated, then activate others individually until you see the errors happening.

  46. Karen January 4, 2014 at 12:16 pm #

    Hello

    I am considering a complete WordPress re-installation. How can I save my group settings? Are they in the plugin folder?

    Thank you
    Karen

    • antonio January 8, 2014 at 12:25 pm #

      Hi,
      right now there isn’t an export/import option. You can access to database and save/restore the wp_groups_xxxx tables.
      cheers

  47. Ben January 1, 2014 at 1:59 pm #

    I have a new multisite network set up with one main site that is running WooCommerce, Groups, Groups Subscriptions, etc… When I attempt to add a new site in the network admin, it partially creates the site and freezes in the process. It acts similarly when I attempt to delete a site… have been testing to see what’s going on. Here’s what I get in the error log when I try to delete:

    PHP Fatal error: Call to undefined function wp_cache_reset() in /nas/wp/www/cluster-1364/simplyapilgrim/wp-content/plugins/groups/lib/core/class-groups-controller.php on line 42, referer: http://simplyapilgrim.com/wp-admin/network/sites.php?action=confirm&action2=deleteblog&id=6&msg=You+are+about+to+delete+the+site+test3.&_wpnonce=6f4d4b0686

    When Groups is deactivated, the add/delete sites works fine. I’m not experienced enough with this to know how to proceed from here. I really want to keep the setup I have with Groups and WooCommerce… it works well for what we’re trying to accomplish. Any insight?

    • kento January 3, 2014 at 9:02 am #

      Hi Ben,

      What versions are you running please? WordPress and Groups.

  48. Karen December 31, 2013 at 11:23 am #

    Hi

    Is it possible to only allow group members to comment sitewide even when the posts are accessible to the public?

    WooCommerce forces people to register before commenting, but there is a loophole if you allow registration at checkout, someone could register then cancel the purchase.

    Could I block this using groups?

    Thanks!
    Karen

    • kento January 2, 2014 at 3:41 pm #

      Hi Karen,

      There is an extension about to be released that allows to restrict access to comments. It will allow you to determine who is allowed to post a comment based on group memberships and also to restrict which groups may view comments. In both cases this will be possible per post type and can be fine-tuned for individual posts.

      Cheers

      • Karen January 4, 2014 at 12:20 pm #

        Hi Kento

        That’s fantastic! I will definitely buy it. Please keep me updated – add me to your mailing list.

        Regards
        Karen

      • Karen January 6, 2014 at 11:15 am #

        Hello again Kento

        While you’re working on that extension, please also make the comments invisible to non-members – or give that option?

        Thanks! I look forward to paying for a service from you, I haven’t needed any of your paid plugins yet, perhaps you should segment your group offering so that you can earn something from it. It definitely is PRO quality.

        Regards
        Karen

        • kento January 9, 2014 at 9:07 am #

          Hi Karen,

          With the GRCP, the comments can be hidden from non-members by restricting them to a specific group. This can be the Registered group of which all users are members, effectively hiding comments from visitors who are not logged in, or any particular group with which you would reduce those who can view them to that group (or groups, as more than one can be specified).

          Many thanks for what you say about Groups, I really appreciate it. I think the Groups plugin itself should stay free and should be supported by the premium extensions as it is now. I don’t think that we will have a Groups Pro, but rather continue with more specific extensions that add value for those whose use cases match the requirements met by the extensions.

          Cheers

  49. Richard Tandoh December 30, 2013 at 2:03 am #

    Hi

    I have used Groups (1.4.4), Groups 404 Redirect (1.1.2), WooCommerce (2.0.20), Groups WooCommerce (1.5.2) and WooCommerce Subscriptions (1.4.5) to build a WordPress (3.7.1) site where users buy subscriptions to gain access to site content.

    I have one remaining bug that is stopping me from launching the site. Logged in users see my main menu as I created it (Appearance > Menus) but users that are not logged in only see part of it. In one case, the top level menu item does not appear and the sub-menu items appear in the main menu. In the second case, the top level item appears but only one of a list of sub-menu items appears.

    When I deactivate Groups the issue goes away, which would suggest the issue is related to said plugin. I was therefore wondering if you might be able to provide some guidance in resolving the issue.

    Thanks.

    Richard

    • kento December 30, 2013 at 1:01 pm #

      Hi Richard,

      What you describe seems to reflect the intended behavior, as it takes the access restrictions into account for these menu items. To override that, you could use custom links, i.e. those that you add under Appearance > Menus > Links, as these will appear independently of the access restrictions of the pages they point to.

      • Richard Tandoh December 30, 2013 at 4:58 pm #

        Kento

        Thanks for the reply. Your override suggestion looks to be working, which is good.

        I am still keen to understand what is happening when I use Pages and Categories to build my menu though, as I still don’t think what I am seeing is correct behaviour. Firstly the pages that are not showing up have no access restrictions applied to them. Secondly, I am also experiencing the issue with categories and I don’t believe that restrictions can be applied to categories. Any further ideas? Also, could you kindly confirm that restrictions cannot be applied to categories?

        Thanks,
        Richard

        • kento January 3, 2014 at 8:57 am #

          Hi Richard,

          The categories aren’t restricted by the plugin and the menu items for these either, I would assume that you have another plugin restricting access to those.

          • Richard January 8, 2014 at 1:27 am #

            Kento

            Thanks. I’ll use custom links for now and then see if I can identify the conflict. I have another issue, but I will add a separate comment.

            rt.

  50. Oscar December 29, 2013 at 2:45 am #

    Hi guys, and thank you for a great plugin.
    I have struggled with not being able to apply an access restriction (or quick-create one) in the meta-box within posts in my custom post types (but not in posts or pages) while having the “Administrators override…” option unmarked in Options: although the select would get populated with the right groups/capabilities, in selecting them they would not be saved.

    I have finally found the reason for my problem and something I thought might be useful to others (and that might be considered a little bug in the plugin itself). If in adding your CPT you use a capability_type other than your CPT name (either explicitly or by not including a declaration, thus defaulting to “post”), line 354 of Groups 1.4.4 class-groups-access-meta-boxes.php will not allow the process to continue because it reads
    if ( current_user_can( ‘edit_’.$post_type, $post_id ) )
    The $post_type being the $_POST[“post_type”] of line 348 means that for the process to continue your user should have a cap “edit_YOUR_CPT” when in reality, in order to edit the post, you most likely only need “edit_posts” or anything else you have defined your CPT capability_type to be.
    As mentioned, this will be an issue only if you disable the “Administrators override…” option or if you need to give restriction powers to another non-admin user, otherwise this limitation will be, well, overridden.

    The way to solve this, other than continuing with the “Administrators override….” option marked, is to set your CPT to
    ‘capability_type’ => array( ‘CPT_SINGULAR_NAME’, ‘CPT_PLURAL_NAME’ ),
    ‘map_meta_cap’ => true,

    and then to add all the corresponding capabilities to your user.

    A better solution would be to make use of the right editing capability (probably making use of get_post_type_capabilities() ), something I have not tried and that would very much appreciate from the devs.

    Cheers and thanks again for a very useful plugin.

    • kento December 30, 2013 at 5:33 pm #

      Hi Oscar,

      Many thanks for the details on this, I think your suggestion to use get_post_type_capabilities() is a much more appropriate solution than how it is implemented currently. I’m having a look at this right now.

      Cheers

    • kento December 30, 2013 at 8:51 pm #

      Here are the changes in a branch if you’d like to give it a try. Seems to work fine but we’ll do more exhaustive testing before issuing a release. https://github.com/itthinx/groups/tree/access-post-type-capabilities

      • Oscar January 2, 2014 at 6:06 pm #

        Hi Kento, and thank you for your quick fix. I have tested the branch on both my vanilla 3.8 install with a random CPT and on my dev project (also 3.8, this time stripping the extra caps from the CPT registration as well as from the non admin user accessing the edit screens) and adding and deleting restrictions as well as creating new ones with quick-create all worked as expected. I will continue to use Groups with this changes on my dev project until Groups next update, and will let you know if I encounter any problems with it in the meanwhile.

        Cheers and thanks again,

        • kento January 3, 2014 at 11:24 pm #

          Thanks for your feedback Oscar, this has been added within version 1.4.5 which has just been released.

Leave a Reply

We use cookies to optimize your experience on our site and assume you're OK with that if you stay.
OK, hide this message.

Affiliates · Contact · Jobs · Terms & Conditions · Privacy Policy · Documentation · Downloads · Useful Plugins · My Account

Share