Groups

groups-512x512
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,261 comments

  • Claudio

    hi..looks good …ithere any way or shortcode i can use to show the number of registered users in a group or sub group.
    ciao
    Claudio

  • shawn

    Is there currently any way to say ‘if user-group = x’ then ‘allow access to blog id#4′ in a WordPress multisite subfolder installation?

    Basically I created a blog ‘members’ in multisite where all of my members content resides. Trying to find the easiest solution to only allow certain groups to access that blog. guests/visitors see page saying members-only with options to register.

    Is this currently, or considered for future updates?

    *After a lot of trying determined s2members is not capable of this
    wpmu memberships plugin comes close but still has issues after weeks of trying with their devs. Pretty much I do not see a current easy to use solution to this.

    • I find that very interesting.

      From what you say, I understand that you would like to grant access to a certain blog based on group membership. There are at least two perspectives that I can offer to that:

      1 – Grant access to the whole blog based on group membership
      2 – Grant access to a blog’s articles based on group capabilities

      With the current beta-1 you can do #2 but you can’t do #1 directly. To do #2 you simply protect all entries by the groups_read_post capability and assign that capability to the privileged group on each blog that you want to protect. For #1 it’s certainly something to consider and for #2 I’d say one would have to reduce the capabilities of the subscriber role and add those back on to the privileged group(s). Of course #1 would be much easier to handle on large deployments … actually I found myself wondering today why not allow to remove capabilities based on group membership because it might have come in handy on a project. Anyhow, if you’d like to try #2 and let me know about how it suits what you’re trying to achieve? There’s room for useful features …

      • shawn

        #1 would be much easier for larger systems. Having a simple blog url restriction rule that covers all the content on that particular blog for a certain group would be easy to handle.

        #2 becomes more difficult to maintain, esp as I am not just protecting posts, but custom post-types, taxonomies, forums, etc.

        well hope some of the ideas are valid.

        I’ve been on this journey for a few weeks now and frankly, there really isn’t an elegant solution available for multisite setups.

        • I agree and to do #1 seems challenging … also it would be interesting to take a look at the use cases.

          • shawn

            Just checking back to see if #1 ever made it into the groups plugin.

            My specific use case as you asked for it:
            I create a completely separate blog on my network for support which holds my support docs, bbPress forums etc.

            I have a setup where when a user purchases a product via woocommerce, then they are added to a ‘members’ group.

            You have to be a member of the ‘members’ group in order to access the ‘members-only’ blog I talked about earlier. Everyone else gets sent to a page saying members only, please signup.

            *I am not currently using your plugin for this, but rather a couple of others with a lot of personal hacks built in. Looking for a more elegant solution.

          • This is EXACTLY what I want to do. Did this ever get resolved? I looked at S2 members and it looks like it can do it if you pay $300 for a network licence but it doesn’t integrate with with Woo Commerce and my preferred payment gateways. You guys should charge extra for multi-site version. I’d pay.

            • Hi Dave, you mean #1? There’s Groups Blog Protect which is a start toward that, it’s taking the Registered group into account only as it is now, but it wouldn’t be difficult to enhance the plugin to achieve this for any group. What I would like to see in that case, would also be a way to have groups across the network. Is that in line with what you’re looking for? Ideas are very welcome.

  • ricardo

    I could not get it to add capabilities (nothing would happen). What else is required?

    • How did you add the capability? If you did it on the Groups > Capabilities screen the capability has been added. Have you checked your filters on top?

    • What happened here was probably related to the issue with the capability table. This has been taken care of in the latest release.

  • iamjwk

    Played around with the plugin and have following feedback:
    1. Assigning capabilities to a group is time intensive; you have to assign capability for capability via the dropdown. Would be handy to have list of capabilities on the group edit screen in which the checkboxes can be ticked for required capabilities.

    2. Currently am not going to use this plugin although it looks very promising. Reason is that visibility of posts is completely dependent on the capability “groups_read_post”, while I would like to assign groups to the post, so I can for example make certain posts visible to family members only and not to friends. But each group would require the groups_read_post capability to make sure they can read other posts.

    • Thanks for trying it and sharing that :)
      Regarding 1 – if you want to assign multiple capabilities to groups it would really be a nice option to be able to do that.
      On 2 – I can see what you mean. It would make sense to be able to use your own choice of capabilities.

      • Allan EDMOND

        Hi,
        When I add a capability and click save, nothing happens and the page stays on the Add a capability.
        If I go to groups then back again to capabilities, there is nothing added.
        Any tip ?

  • Hi Kento,

    We are a small consulting company and would like to have customer specific pages and posts on our site that would require a customer to login in order to see their specific content. Each customer will have a unique set of pages with information confidential to their business.

    Does your plugin sound like a fit for our use case?

    Two other questions:

    1. Is there a way to protect files so that customers can only download files specific to their group?

    2. Is protected content hidden from WordPress’s search results?

    Thank you!
    Bill

    • Hi Bill,

      Thanks for considering to work with Groups. Wouldn’t a multisite seem like the appropriate solution for this? You could add a site for each customer and protect its posts using the standard access restriction that Groups provides. This might even add prestige, as each site can reflect the customer’s corporate identity.

      Regarding the other questions:
      1 – Unless the files are protected by additional means, anyone who knows the file’s URL will be able to access it.
      2 – Yes.

      • Hi Kento,

        Thank you for your reply and your ideas. Re: Your Multi-Site suggestion: An excellent idea, but we’d like to keep all our content in a single site.

        We’ll give your plugin a shot and see how it works.

        Regards,
        Bill

        • Update regarding 1 – protect files so that customers can only download files specific to their group – the Groups File Access plugin provides that functionality.

        • I like your idea Bill about customer specific pages. It is what I want to achieve. I like your idea also Kento using Multi-Site. I will try to merge your ideas and make a private-secure folder for each client, not a website for each client.

      • Jonas

        Kento, how could I open an exception so that WordPress search result show the hidden content?

        I already have my website setup that only the excerpt shows up in non-hidden articles, but I need the excerpt to show up in search results.

  • Bob

    Can I get this to work with buddypress groups? double entry?

  • elvis

    Hi
    I am interested in using Groups, as I would like to group content for people to view but not limit access.
    For me i would really like
    1. php code in addition to the posting shortcodes (for more varied content)
    2. to be able to list ‘my groups’ for logged in user
    3. as iamjwk suggested above, I would need to add certain posts or categories to groups.

    I haven’t tried using ‘do_shortcode’ for point 1. but the other 2 are essential to me at the moment.
    It would be great to look into these if you are continuing to develop.
    thanks
    elvis

    • Thanks for your suggestions elvis, yes this is actively being developed further and what you propose makes sense to me as well. We can expect to see 2 and 3 done shortly and the documentation that is being prepared will help people to understand the API to integrate with their own projects.

    • On 2 – As of Groups version 1.1.5 you can list the groups for a user using the [groups_user_groups] shortcode. 3 is being worked on and 1 is provided through the API.

  • Roger

    Hi, this is perfect for my needs…if I can get the shortcodes to work. If I want to have a bit of content appear for members and a suggestion to register appear for non-members, wouldn’t this be right?

    [groups_member group="1"]Here’s your content.[/groups_member]
    [groups_non_member group="1"]Please register.[/groups_non_member]

    This works to hide or show the first bit, but the “please register” message is never hidden, group members see it as well as non-group members (and not just administrators). This is on the latest version of WP.

    Also, I never seem to be able to unset the administrator override. Thanks for writing the plugin!

    • Could you try it like this please?


      [groups_member group="Registered"]

      This is visible to registered users only.

      [/groups_member]

      [groups_non_member group="Registered"]

      This is visible to non-registered users only.

      [/groups_non_member]

      I would say it’s either because the actual content is not on a new line (as in the example I give above) or it might have to do with the double quotes used (e.g. using right double quotes instead of normal double quotes).

      Hey also great to see this suits you, please let me know if the above solves it.

      Thanks also for mentioning the administrator override issue, this looks like a bug – will need to fix it ;)

  • Roger

    I switched to single quotes, though I was definitely using normal double quotes before, and it works. Yay! Thanks again.

  • I would like all users to be able to access all my site content but I would like to control the email announcements of blog posts.

    Example 1:
    Real-Time Group – Gets email notice as posts are published
    Daily Group – Gets email notice of new posts once a day
    Weekly Group – Gets email notice of new posts weekly

    Can I use Group to accomplish this?

  • Ben

    How can I use your plugin to hide an entire page? Example:

    All registered users can see Pages A, B, and C
    Members of Group A can see Pages D, E, F, and X as well
    Members of Group B can see Pages X, Y, and Z as well

    Would like to have the entire Page hidden so it appears in the site navigation for the appropriate users only.

    Thank you!

    • Thanks for the input Ben, in the current version 1.0.0-beta-3 Groups handles access to posts through the groups_read_post capability. This controls access to posts via back and front end but has its limitations – if a Group has the capability, its members can access any page that requires it. This is going to be changed so that cases like the one you describe can be covered easily as well.
      Meanwhile (it’s not the ideal but an option for your case) you could wrap the content of the pages in question within Groups’ [groups_member] shortcode. Most probably the next release will cover your case fully.

      • Troy

        Hi Kento, I seem to be facing this same issue having just installed your wicked plugin this morning. Has this been updated yet as it seems any of my users once logged in can see all protected pages even though I’ve set the enforce read access on each.

        I am working with a Staff/Agent/Retailer scenario where staff can everything,.. Agents can see everything but Staff content,.. and retailers can only see retail info?

        • Hi Troy,

          Is there any other plugin that also tries to restrict or open up access to those pages? If you have the access restricitons in place, it doesn’t grant access unless something else interferes.

  • Hey there itthinx,

    Just installed the plugin, I am planning on using it to manage our Street Team. It is pretty redundant but I would like to be able to have a member be able to press a button and be automatically added to a certain group. Can this be done?

    Thanks!

    • Hi Peter,
      Yes you can do that through the API. Your button handler could end up adding the user to a group:
      Groups_User_Group::create( array( 'user_id' => $user_id, 'group_id' => $group_id ) );
      Hope that helps, Cheers!

  • Mango

    I need a paid subscription group membership. Can I use Groups together with a paid subscription plugin?

  • Len

    Same problem with adding new Capabilities
    I did some checking and the capabilities table does not exist!!
    It was there… but I have deactivated/activated the plugin a couple of times – requesting it delete all its data – which it does successfully.. but the activate does not seem to create the capabilities table – all the others are there – – nothing obviously wrong in the controller.php – so I’m puzzled…
    WP 3.3.1 – Plugin Beta 3

  • Michael

    Can I email the members of my groups, please? If not, is anything planned for the future that might let me do this at some stage? BTW – thanks for the plug-in – works great so far. This one little addition would make it perfect for me!

    • Thanks Michael, it would be fairly easy to build that functionality, given that Groups’ API provides everything necessary for that. It’s a feature that surely would be welcome in many cases, probably as an extension but currently I can’t give an estimate for when this would be available because the next release of the Groups core has to come first.

  • John

    I don’t see any way to add users to a group on either the group or user menu. Did I miss something during install?

  • Paul

    Hi! Please help me. Can I add my own capability checkbox to Access restrictons meta box on posts and pages, which provides read access to the group I created?

    • This is going to be possible in the next release. It’s already being developed.

      • Paul

        Thanks for the response! And when the following release is planned? This possibility is necessary to me very urgently((

        • An exact date for that isn’t there yet, the project’s powered exclusively by my own resources right now but I hope that it won’t take long as it’s something that I would like to see as soon possible.

  • MihaiCr

    I need to use another shortcode inside.
    Example:
    [groups_member group="Registered"]
    [GLOBALMAP]
    [/groups_member]
    Show: [GLOBALMAP] instead of real map
    Example2:
    [groups_member group="Registered"]
    [contact-form-7 id="38" title="Contact form 1"]
    [/groups_member]
    Show: [contact-form-7 id="38" title="Contact form 1"] instead of form

    Please help

    • Ok, I don’t quite get what exactly is your question. Could you please explain? The nested shortcodes should work, do you see any issues there?

      • MihaiCr

        Sorry, my English is very poor.
        The following page http://www.zofoptogerman.ro/auto/?page_id=8 contains:
        ___________________________________________
        [groups_non_member group="Registered"]
        Please complete the following form:
        [contact-form-7 id="38" title="Contact form 1"]
        [/groups_non_member]
        [groups_member group="Registered"]
        [GLOBALMAP]
        [/groups_member]
        ___________________________________

        What you see is in page is:
        Please complete the following form:
        [contact-form-7 id="38" title="Contact form 1"]

        When i use just:
        Please complete the following form:
        [contact-form-7 id="38" title="Contact form 1"]
        without
        [groups_non_member group="Registered"]…..
        in the page it’s show the form like this:
        http://www.zofoptogerman.ro/auto/?page_id=44

  • Bazzer

    I am attempting to use your plugin but the capabilities area is empty and when I try to add a few that I see on the screen shots of the plugin, nothing happens, a bit disappointing so far

  • Minaki

    Do you know how can i make a user from a group (Group 1, for example) see only members from that group in the Users page?

    Nice plugin, bytheway =D

    • Hey thanks Minaki :)
      Currently I only see two feasible solutions for that, one would be to create a custom Users page which uses Groups’ API to make that work, the other one would do a similar thing on the front end. So yes it can be done with Groups but it would have to be coded. I hope that helps.

  • Ted

    Hi

    Sorry I hope I am not being to lazy. is it possible to let users define the group field on one of my plubic website page (E.g. “register a group” page). Thanks for replying

  • Fabien

    How to get the author groups from theme template (php) ???

    • Do you want to show what groups the author belongs to? Have a look at the Groups_User_Group class and related, you should be able to understand how to retrieve that from it.

  • Hey Kento, I have a website that uses wishlist member. First question: Does groups work with wishlist?
    Second is: Can users be added on the front end? Because I created a front end dashboard on the site. So everything has to be front end :)
    Third: Users will register to wishlist, can they add themselves on the group?

    Hope you can clear this for me, and really great work on the plugin. Been looking for this feature for a long time :)
    Thanks man!

    • Hi Sanjay, thanks for your comment. There is no integration with WLM for Groups although maybe you can do that depending on what exactly you need to do. Sure you can add users to groups from the front end, have a look at the classes that handle users and groups, it’s very easy to use. Same thing for your third question, you can provide a means for them to add themselves to a group.

  • Hello,
    If I already have many groups set up already in my site will your groups show up or not? I have over 3,000 groups set up on my site right now and though I tried to set up two new groups with the Groups plugin, I cannot see them live on my site. Or is it due to plugin incompatibility? I have BP Group Hierarchy and BP Group Management also installed.

    Thank you,
    Margy

    • Hi Margy, actually the Groups plugin is completely independent of BP. I understand what you expected to see, but as these are different systems and no integration has been done, it won’t be possible – at least for now. Cheers

  • JD

    Hi, Kento! Great plugin!

    Above Peter asked about how to make it so a a user could automatically be added to a certain group when they clicked a button. I would like to be able to have a button like that, but I am a newbie and I don’t have the slightest idea how. I would really appreciate some help.

    Thanks,
    JD

    • Hi JD, basically you use the API call that I’ve mentioned in my reply to Peter. If you don’t know how to use that information, right now it would be rather difficult for you to achieve this. Maybe at some point that button thing could be a good idea to offer as a shortcode. Then it would simply be placing the shortcode where needed and it would work. Let’s see if there is more interest in having that and it’s worth the effort of adding it …

  • JD

    Okay, thanks, Kento. I really don’t know what to do with that information but I will try to figure it out.

    Thanks again,
    JD

  • I installed Groups in my WP blog website. I wanted to create a group that would be able to read and write to private posts and private pages. Not only was I unable to make it work, Groups has now rendered the pages of my website undisplayable. I am able to open and edit a page or post in the dashboard — the content is still present — but it will not display when I try to load the page or when I click VIEW when looking at the content the edit screen. I tried disabling Groups and that doesn’t make any difference. I’m rather desperate. Can you help please?

    • That sounds like a conflict with another plugin on your site. What you can do for now is go to your plugins directory and delete the groups folder. Please let me know what other plugins you have installed and activated as well as the current theme, we can then check to see what’s causing that.

  • Thank you, Kento. I deleted the Groups folder and deactivated my plugins and the display came back. Now I am checking which plugin was in conflict… OK, apparently the conflict was with Wiziapp. I had not created an app with it so I deactivated it and everything is fine. Thanks again for your help!

  • Hi, please allow me to quote from a previous comment

    Quote: “Hi
    I am interested in using Groups, as I would like to group content for people to view but not limit access.
    For me i would really like

    2. to be able to list ‘my groups’ for logged in user”

    Has this feature been updated yet? .. I am really scratching my head because i can’t access my groups. I just installed the plugin and i created one additional group.

    I was really expecting to see a link menu item called ‘Groups’ in the navigation bar on the live site, such as i have seen on another website.

    I cannot see it even when i am logged in! Meaning i can’t access my own groups to start adding content.

    And the available shortcodes can’t seem to realise this. I want the Groups menu item in the navigation bar to be visible also for regular non member/non registered visitors (but not the actual content, instead just a list of available groups on the site)

    Please help me.

    Thanks

    Betty

    • Hi Betty, thanks for the suggestions. You are looking for two features then, list a user’s groups and list the site’s groups? But I assume you would also want to link these to content assigned to each group. You mention “I would like to group content for people to view but not limit access.” – wouldn’t categories work for you? In that case, you don’t really need the groups, just categorize your posts.

  • Hi, we use the groups plugin, and we were wondering if there was a way to make more capability show up on the menu at the top right when making a post or page, to only allow groups with that capibilty to get to that page, as we all ready use groups_read_post for moderators.

    Any help would be appreciated.

    • Thanks for asking, it’s being worked on right now. There is a new release being prepared which will officially pull Groups out of beta, it’s not sure yet whether that is going to be available with the new release, if not, it won’t take long.

  • Per

    Hi
    I have a strange issue, when using your plugin I got an issue in other plugin Mailpress. The issue is that content in mail created via Mailpress is not showing up at all. It works as normal if I deactive your plugin.

    I have tested to add in all capabilities to a certain admin group and add in admin into this this group, dont work. I have tried the option to have administrator override marked, dont work.

    Any idea what the problem can be and hor can I solve it?

    Per

  • Hello,

    In my wordpress general options there is a default user role set to new users. I was wondering if there was a way to set a custom user role to someone registering as an affiliate with affiliates pro?

    Could I use this plugin to achieve this?

    What I really wanna do is have all new affiliate sign up with a custom user role and not the default one set-up with wordpress.

    • That’s possible but you don’t need Groups to do that. You don’t need Affiliates Pro for that either. If you don’t mind posting this on the Affiliates plugin page, I should be able to show you how it can be done.

  • Hi,
    Great Plugin. I’ll be getting the downloads version at Codecanyon.net
    I’ll be bulk uploading tens of thousands of posts and users. I’ll need to bulk upload a post and Access restriction groups_read_post. Also, I’ll need to upload users wiht their groups_member group. (I’ll ftp images.) Everything will tie back to the post ID/slug. I’ll also tie in downloads.
    What is the best method for uploading thousands of posts and users with the groups_read_post, and users with their groups_member group(s)?
    BTW: I’ve been searching for a solution for 2 days. This is the best!!
    Cheers,
    Jack

    • Hi Jack,

      There is this plugin https://github.com/joeyblake/WP-Bulk-Posts-Meta I haven’t used it myself, but it sounds like it might help you. If it works as I assume, it should let you assign groups_read_post to the posts’ meta. Note that as of version 1.2.0 you will have to assign meta_key = ‘groups-groups_read_post’ and meta_value = ‘groups_read_post’ or any other capability you want to use (this is new, before 1.2.0 you could only use groups_read_post to restrict access, now you can use any capability).

      For the users, I would simply use the bulk assign feature available on the Users admin screen. Select all you want to assign to a group, select the group and click Add.

      I hope that helps, let me know how it turns out.

      Cheers

  • Hi,
    I found groups_read_post under wp_groups_capability in the sqltable. So, it could be populated via csv direct into sql for bulk groups. I think. As to the user groups_member it would be best for the user to do it. But, how without making a mess with key entry errors. I think the author field for a post couuld be their group. An ajax summarizing all authors alphabetially in the profile page letting them select their author (group) could make an error free, simple group allocation that is moderation-free. I think.
    I ain’t no programmer, so …..
    Cheers,
    J

    • Ok now you’ve lost me here ;) – what exactly do you want to achieve?

      • Hi,

        Thank you.

        I’ll have large numbers of posts, groups, and users. So, bulk upload is my only option.

        A previous post mentioned the user should have an ability to pic their group and an admin approve. This would be great since users make mistakes and it would allow the admin to keep the group clean–not me.

        I’ll likely use multisite to break up the large number of posts and assign it to one group per your suggestion above. So, that will help alot.

        Regards,
        V

  • Frank

    Hi,

    This plugin seems to offer what I need. I need to create different group of user that represents geographical regions. Users can only read and write posts for the respective region. How could I achieve that? Is there any example I could refer ?

    Thanks in advance !

    • Hi Frank,

      Quite easy actually for reading: create a group for each region and a capability for each, check the capabilities created under Access Restrictions in Groups > Options and on the posts limit access by checking the appropriate capability.

      Example:
      Groups : US, UK
      Capabilities : create read_US, read_UK and assign these to the above groups; check them under Access Restrictions
      Posts : create a couple of posts, A and B, check read_US for post A, check read_UK for post B

      Members of the US group can read post A but not post B, those in the UK group can read post B but not post A.

      About write access it’s different, maybe it’s sufficient to let editors decide by checking the capabilities in the post?

      • Frank

        Actually, I am using the P2 theme and user can write Post on the front-end so there should be no possibility to for checking the capabilities. Do I have to action hooks or something like that in the functions.php file ?

  • Hi Kento,

    Love the plugin and Group File Access extension!

    I’m trying to write a custom page template that all logged-in users can access, which will be dynamically populated with all files available to the current user, categorized by group.

    In order to do so, I need to create:

    1) An array of all groups the current user is in;
    2) A multi-dimensional array of all files available to that group, which contains the filename, upload date, user who uploaded it, and download URL.

    My page template will be laid out as follows (written logically):

    if user is not logged in {

    display login form

    } else {

    div tab-index
    foreach group the user is in {
    div group (group name) /div
    }
    /div tab-index

    div tabs
    foreach group the user is in {
    foreach file available to that group {
    div file (name, date, author, download link) /div
    }
    }
    /div tabs

    }

    • Hi Shaun,

      For 1) you can use:
      $user = new Groups_User( $user_id );
      $groups = $user->groups;

      And for 2) you could use the groups_file_link() method I mentioned in http://www.itthinx.com/plugins/groups/#comment-1637 (defined in groups-file-access/lib/views/class-gfa-shortcodes.php) or you can use it as a basis for your own variant showing the data you want. Note that ‘user who uploaded it’ isn’t stored so you won’t be able to retrieve that information.

      I hope that helps you with the template.
      Cheers

      • This is great, thank you! I will keep you posted and share a pastebin of the page template when I get it working.

        Also, you may want to consider storing the uploader user id in a future version of your plugin. It wouldn’t hurt and, at least in my case, would definitely help to keep file revisions organized on the front end without relying on users to provide self-evident file names.

        Thanks again!

        • Thanks Shaun, that would be interesting to see :)
          I also see the use of the uploader or ‘owner’ of a file being stored, I’ll consider it for the next update of GFA.

  • Just to clarify, I was hoping you could identify for me which function/method/class contains the information I need, so I can store it in my arrays.

    Any help you can provide would be greatly appreciated.

    Thanks in advance!

    • Hi Shaun, got to to take a quick look at that today but couldn’t get to write an outline for this yet. A quick hint, you might want to have a look at the GFA_Shortcodes class and its class method groups_file_link, you could basically iterate over that for each group or derive what you need from there (first option should be simpler). Let me know if that helps for now …

  • Doesn’t work on WordPress 3.4 – causes 500 internal server error on wp-admin.

    • Groups works perfectly well on WordPress 3.4, I suggest you check your server logs to see where the error is caused. It’s not Groups.

      • Groups enabled = HTTP 500, Groups disabled = no error. May be an incompatibility with another plugin but none of them are even remotely connected to ACLs or any of the functionality of this plugin.

  • DaveR

    Hi. I’m trying to set up a new site and have it bare bones on my localhost using MAMP. WP 3.4, 2011 theme (WP) and only Peter’s Redirect going. I have Admin, users 1 and 2 and just a few posts for each. I made 2 pages, one fixed for Front Page and the other for posts. I’m setting all posts to private. Now it’s working like I want – almost. Admin can see everything where it should: Dashboard>allposts and posts page on site; and each user can see only their own posts.

    My goal is to have each user interact with only the Admin and no other user. (It’s a service oriented business – custom digital products). What I want is to post and have that post only visible by 1 user – the one I want to direct the communication to. I can do this if I use the little dropdown and apply their Author ID, but I want the posts to show up as Admin, not User1, etc. Therefore I thought I’d make groups for each client that includes only 2 members – admin+User1, Admin+User2, etc.

    I was able to create the groups but don’t see a way to post so only the group member(s) can see it. “groups_read_post” is checked.

    Am I missing something here? Otherwise it looks like what I need.

    I hope that’s clear.

    • You’re almost there, have a look at this comment, it explains how to make posts visible to members of a certain group only. Basically you create a capability for each group and use that to restrict access to the post. Let me know if you need more info on that or you manage following the instructions in the comment mentioned.

  • I am very technically capable — a database applications programmer. Novice in wordpress.

    First goal: I would like each user to have a personal PAGE on the site which they can edit, without also giving them the capability of creating new pages.

    I have found that if I create a user and add the edit_pages capability, then log in as them, I can create a page which they can edit. However, then they can also create new pages. If I change the capability to edit_published_pages, then they cannot edit the page at all (page is not listed in the admin panel).

    I would also like to know the best way to familiarize myself with the entire Groups model and the implementation of short codes. It seems the explanations I’ve seen published assume a foundation of knowledge I don’t yet have.

    Thanks!

    • Hi Christian,

      For the personal pages you could add the edit_pages capability to the Registered group, keeping in mind that they will be able to add new pages and edit those they have authored, but they will not be able to publish them – an admin will have to do that.

      So this would allow them to add new pages and edit their own, but they will stay hidden as long as they are pending review. If you really want to create something that will let them publish only one page, I would rather create a new custom content type, for example a Profile type, where you control a edit_profile capability that will be granted based on the number of Profiles a user has published. Then assign the edit_profile capability to the Registered group and voilà, they can edit their own Profile and have at most one. That involves coding the custom content type or you could use a plugin that lets you create a custom content type through the admin interface (I don’t remember which right now, but I know there are).

      To get a good idea of how Groups works, I would recommend you to first use it to achieve the goal above, play around with the shortcodes it provides and then have a look at the code, it’s documented and you should be able to derive any additional functionality using the existing shortcode implementations as a basis.

      Cheers

  • Hello I very hopefully installed Groups,and got no error messages then, The goups icon also appears in the plugin menu. However when lpressing that I get the follwing fatal error:

    Fatal error: Call to undefined method stdClass::add_help_tab() in C:\domains\harrybooltink.nl\wwwroot\cms\wp-content\plugins\groups\lib\core\class-groups-help.php on line 100

    Can anybody help me?

    • This is because that method was introduced in WordPress 3.3. Thanks for reporting that, either the Groups compatibility with WordPress must be updated or a fix added for when that method doesn’t exist. For your case, if you update WordPress it will go away.

  • Just downloaded and installed Groups. Brilliant work. I have a questions regarding the use of “more” or “read more” in posts that have Groups shortcodes in them.

    What I want to do, it display an error message is the user is not a member of a group. I’m using:

    [group_non_member group="read]
    Sorry, you need to be a member to read more.
    [/group_non_member]

    [group_member group="read"]

    the rest of the content of the blog post.
    [/group_member]

    What I’m experiencing is that the WordPress “read more tag is displayed regardless of the fact the user is a member of a group or not. If I’m NOT a member, and I click on “read more”, and the read more tag disappears.

    Is there a way for Groups to display a message or “sign-up” buttons if the user is not a member of a group?

    Thanks!

    • The shortcodes are missing an ‘s’. The actual shortcodes to use would be for example:

      [groups_member group="read"]
      ...
      [/groups_member]

      Groups doesn’t offer sign-up buttons (yet), but have a look at Groups WooCommerce which allows you to sell memberships.

  • Sorry, the blank line after [group_member group="read"] is supposed to be a standard WordPress “readmore” tag.

  • I’m trying to allow for end users on my site to dynamically create and/or associate themselves with a group using a form on my site.
    So when a user fills out the form, they will either choose to be associate with a current group, or be given an option to create a new group.
    Is this possible?

  • RJ

    Is there any capability yet to show/hide menu items for specific groups?

    • Basically yes and implicit, create a capability, assign it to a group, restrict access on page or post and it will be shown only to the group.

      • RJ

        Perhaps I wasn’t clear or I do not understand.
        I want to show a link in the actual menu for a specific logged in group and hide the link for all others.

        • You mean menus on front or back end?

          • RJ

            Menus on the front end for visitors.

            • If you’re adding the menu item from Appearance > Menus through the Pages panel for example, given that the page has access restricted by one of Groups’ capabilities, then the menu item will only appear if the user belongs to a Group that has that capability. That holds if the theme respects the access rights. If you are using custom links then it’s independent and the menu item will be added without regard to the restrictions. In that case it will appear, but the page itself won’t be accessible. You can try that yourself, just add a page, restrict access, add the menu item once through the Pages panel and once through the Custom Links panel.

          • RJ

            Great! Would this also work for categories added from the categories panel assuming the category was restricted to the group?

            • As you can’t restrict access to a category that wouldn’t work. You would have to restrict access to the individual posts in that category.

  • Hi!
    Is it possible to sell memberships that grant access to different web pages, subdomains and blogs?
    Groups, Groups Woocommerce, WC Subscriptions?
    Thanks,

  • Hi Kento and thansk for the relpy!
    I have read the links you sendt to me.
    What I mean is for eaxmple.
    I have three differente webpages
    mysite.com and mysite.com/subdomain/ and anothersite.com

    The plugin is installed at mysite.com/subdomain/
    I want the to restrict access to the other to sites that they do not have the plugin insttalled, mysite.com and anothersite.com
    Is this possible?, to restrict access from one domain to to other different domains? I could not fine an answer for this.
    Thanks,

    • For a subsite, as the users are managed from the main site, you can recreate groups you want and assign them accordingly. If the site is independent though, one possibility is to create a service that for example accepts API calls over HTTPS or SSL and allows to ask for group membership by username on the main site. Obviously that’s quite a complex thing to do, so the answer to this is yes it’s possible, but would it be worth the effort?

  • Arturol

    Hi Kento and thanks for your reply!
    I could not find the right information I need.
    Example.
    I have my main page mysite.com

    Groups WooCommerce is being used at a different address, mysite.com/registration

    I have another address in the network where I intend to have the different groups
    mysite.com/groups

    My question is, how do I automatically assign group memberships (from mysite.com/registration) to a page that belongs to a different address (mysite.com/groups) in the network?

    Can you help?
    Thanks,

  • WooCommerce is being used in a subfolder not subsite.
    Example.
    I have my main page mysite.com
    Groups WooCommerce is being used at a different address, mysite.com/subfolder-registration
    I have another address in the network where I intend to have the different groups
    mysite.com/subfolder-groups
    My question is, how do I automatically assign group memberships (from mysite.com/subfolder-registration) to a page that belongs to a different address (mysite.com/subfolder-groups) in the network?
    Can you help?

    • In that case, do you mean you have two different sites handled by independent WordPress installations that happen to sit on the same domain? If that’s the case then you need to apply a solution like I explained here. What I don’t understand is why do you want to have WooCommerce on one installation to sell group memberships on another installation? It would be straight-forward if you just had WooCommerce on the domain where you want your groups, which is how the whole thing is supposed to be used anyway.

      • Hi Kento!
        I have now move the woocommerce solution to the main site but I get the following bug.
        When I go to checkout page the payment option does not appear.
        I get the following message, so the payment option does not show.

        “YOUR ORDER:
        You do not have permission to edit this post.”

        In order for me to see this payment option i must login first. How could I fix this?
        Thanks,

  • The reason why I have Woocommerce on one installation to sell group membership on another installation is that the installation i have with Woocommerce is the one used for registration to courses an naturally people will be automatically assign to groups when registering. I do not want to use woocommerce in the main site because this will reduce the loading time of my main site, where visitors come first. but if you have a solution like how i can use loads of pluggings on the main site without reducing loading time you’re very welcome to tell me how. I really need some advice ;-)
    Thanks

  • My different sites are handled by the same WordPress Installation tha happen to sit on the same domain. WordPress Installation is not independent, is just the same

    • Ok then it is multisite. Did you measure the difference in performance from one subsite to the other? Try e.g. P3 and let’s see if you would even need to ‘split’ the sites.

  • Arturol

    Yes, i have alreday tried this plugin, i’m using it ;-)

  • Michael

    I have a situation where we do not wish some users to be a member of any group – I won’t bore you with the reasons. But is it possible to arrange things so that users are NOT automatically added to the ‘registered’ group on registration? Or maybe – if they have to be added to a group on registration – they couild be added to a group other than ‘registered’? If it helps, our users are all added by admins – they are not permitted to register/apply themselves.
    TIA

    • If they are added by admins anyway, why not create a new group and add them to that one instead? Then handle whatever you want them to access through capabilities assigned to the new group instead of Registered.

      • Michael

        Thanks – that is what we are currently doing, but it means the admin then has to go back and remove them from the ‘registered’ group. I just wondered if there was a slightly less clumsy way of doing this – say by having the option of which group they joined as part of the ‘Add New User’ process?

        • Why should they have to remove them from the Registered group anyway? If you’re not using that group, they don’t have to remove the users from it either.

          If you consider “having the option of which group they joined” then you would simply add them to another group, which in the end comes up to the same thing, at most renaming the Registered group – but in function there wouldn’t be any difference at all, so the whole thing would be a bit pointless ;)

          Just to clarify, users getting added to the Registered group doesn’t imply anything unless you really work with that group. So you can simply work with other groups you create and assign users as you need without using Registered.

          • Michael

            I understand your argument, but surely the whole point of having groups is that some users aren’t in them? This is why I don’t really see why new users are auto-added (or need to be added) to a group on registration – they are, after all, already added to whatever role is specified as the default within WP itself. Because, as you say, just being in the ‘Registered’ group doesn’t in itself imply anything, it doesn’t seem to have much of a point, unless I’m missing something.

            It’s no big deal. We could/can just leave them all in that group, but, for the sake of a slightly reduced load and just general tidiness, we’ve been removing them.

            • About this “… surely the whole point of having groups is that some users aren’t in them? …” – no, that’s not right. It’s more like the opposite, user sets are identified by groups – the intent is to have users in groups, not to exclude users from them.
              Also Groups does not rely on roles and the Registered group is an entity in important common use cases where Groups is involved.
              And in terms of performance, it doesn’t make a difference whether you keep your set of Registered users small or not – given that your database performs and scales well.

  • Is there a way to assign members in a particular group to a specific wordpress role automatically?

    I’m trying to sell a membership on a WooCommerce site that will give access to all products and specific tutorial posts for free for a year.

    The planned plugin flow is:

    1. Someone buys a subscription membership product
    >> WooSubscriptions plugin
    >> So far so good

    2. This product adds them to a “Gold Member” group
    >> Group WooCommerce & Groups plugins
    >> Working

    3. Gold Members automatically upgraded to gold_member role
    >> No idea how to do this, need your help please
    >> ????????

    4. gold_members get 100% discount on all products
    >> User Role Editor & WooDynamicPricing plugins
    >> Working – after I manually assign member to gold_member role

    5. The Gold Membership runs out after a year
    >> WooSubscriptions plugin
    >> Working

    6. Users removed from “Gold Member” group & gold_member role automatically
    >> No idea how to do this, need your help please
    >> ????????

    This post says it can be done with half the plugins but I have not idea how to do it and the Woo-Support is down: http://www.woothemes.com/support-forum/?viewtopic=84316

    Thanks a lot for your help

    • Of what nature are the products they can access?

      • Wow, thanks for the speedy reply!!

        The products are all digital downloads and the tutorials are just group locked posts – that part is working so far but I have to change the role manually to gold_member after the user buys the “Gold Membership”

        Fine and well when I’m testing it but a customer will want instant access.

        Would be awesome if I could get this to work and there are a lot of folk in the WooSupport forums that want functionallity this too.

  • Hi Kento!
    I have the following questions:
    I offer dance courses and Spanish courses. When people register for courses I do not want them to be automatically registered to a certain group or registered group. Groups will be divided into different levels:
    Example: Begynner, Intermediate , Advanced.
    What I need is that them selv can choose the level they belong to when registering for new courses/ products and afer a period of time I decided they will automatically moved to the next level. Is this possible with WC Groups or do I need another plugin?
    Thanks,

    • Hi Arturol,
      For the first question (when registering for a new course or product), that is easily handled by assigning the group to the product. Just like with the Premium group in the example, you would create Beginner, Intermediate and Advanced groups and products and relate them accordingly.
      To move users around groups automatically can be done but would require some custom coding that would periodically reassign users in one group to another when due. It’s not possible to do it with the plugins OOTB without some coding though.
      Anyhow, if you have Beginner, Intermediate and Advanced, don’t you sell that as an upgrade? If so, you don’t need the automatic reassignment, because they would be part of the next level upon purchase. What I can see might make sense here – and someone already asked for this possibility – is to be able to void membership on a certain group when a user purchases a product. I know that it’s a sensible use case and am planning to include that in an update of the WooCommerce Groups plugin.

  • Nancy Nardi

    I’m using groups and woo commerce groups. I’m trying to set up a protected page for a membership product.

    I want to have a message for non-members with that do not have access, and then of course the content so members have access.

    Using the shortcode instructions above this is what I have:

    [groups_non_member]

    This text can only be seen by non-members

    [/groups_non_member]

    [groups_member group="Group1, Group2"]

    This text can only be seen by members of these groups

    [/groups_member]

    What happens is, members still see the non-member message – which I do not want. And if someone is non-member and is UNREGISTERED they get a 404 page error.

    Am I missing something?

    • You need to provide the group attribute on the [groups_non_member] shortcode as well. See the documentation on Shortcodes for reference.
      If you also protect access to the page, it will only be accessible to members of groups with the appropriate capability that is used to restrict access to the page, that’s why you see the 404.

      • Nancy Nardi

        Thanks for the reply

        I did provide the group attribute on the non-member shortcode and members can still see it. I did read the shortcode documentation – can you be specific.

        Why throw a 404 page instead of redirecting to another page – is that possible? If someone is not a customer it would make sense to redirect them to the store page rather than throwing an error – is it possible to do this?

        This is all I saw for shortcode documentation, and this is exactly what I did:

        These shortcodes are used to limit the visibility of the content they enclose:
        [groups_member]
        [groups_non_member]
        [groups_can]
        [groups_can_not]
        Example:
        [groups_member group="Gold"]
        Only members of the Gold group can see this.
        [/groups_member]

        • Nancy Nardi

          I understand that to avoid the 404 page, to not check access.

          • If you don’t want to restrict access on that page, yes. If you want to restrict access to that page and further restrict access to content on the page, no.

        • The code you posted for the [groups_non_member] shortcode doesn’t specify a group, you have to use it like this:
          [groups_non_member group="Premium"]
          This is shown to those who are not a member of the Premium group.
          [/groups_non_member]

          There are several plugins that handle redirects on 404s, try this search for 404 redirect.

    • Akmal Izzat

      Gosh I hate maths D:

      Yeah this is a feature that SHOULD be included in Groups where unregistered users will be redirected to a page instead of a 404 page when viewing restricted post/page.

      Right now I’m using ’404-to-start’ plugin to handle these kind of problems. You should try this too (I bet you’ve already solved this problem..)

  • Zoe

    Hi there,

    I’m finding your plugin to be helpful and well built so far – thanks for all of your hard work! I’m trying now to apply it to sidebars (or specific widgets – either would work) so that only certain groups can view particular sidebar/ widget content, and running into some difficulty. Are there template tags I could use to do this in the theme or do you have any suggestions for other ways to make it happen?

    Thanks so much!

    • As Michael suggests, the Widget Logic plugin can be used to show widgets conditionally. Example code that can be used in Widget Logic’s field for evaluation:

      $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;

      That would show the widget to users in the Registered group only.

      • Zoe

        Fantastic, thank you!

      • Zoe

        Could you possibly share the code for checking capability as well? Thanks!

        • require_once(ABSPATH . "wp-includes/pluggable.php");
          $groups_user = new Groups_User( get_current_user_id() );
          return $groups_user->can( 'make_donuts' );

          Try it: create the make_donuts capability, create a “Donut Makers” group and assign that capability to the group, assign a user to that group.

      • Arjen

        What do i need to enter when i want to use this for more groups?
        I do not know much about code, i tried several things but that did not work.

        i want to use this to show a certain widget to certain groups.

        thanks in advance

        • antonio

          Hi Arjen,

          if you don’t know much about code, you can create a “supergroup” that contains other groups’s users.
          A code example:

          $result = false;
          require_once(ABSPATH . "wp-includes/pluggable.php");
          $group1 = Groups_Group::read_by_name( 'Premium' ) ;
          $group2 = Groups_Group::read_by_name( 'Gold' ) ;
          if ($group1 || $group2) {
          $result1 = Groups_User_Group::read( get_current_user_id() , $group1->group_id );
          $result2 = Groups_User_Group::read( get_current_user_id() , $group2->group_id );
          }
          return $result1 || $result2;

          cheers

      • Milque

        Hi Kento,

        Have used the Groups plugin for a while. It’s great. Also using Woosidebars. That’s why I’m replying to this part of the comments as thought it was relevant/related.

        Am I correct in saying that these two plugins do not work together? I’ve tried, but nothing works. Not entirely sure if I want to go down the route to Widget Login given yet another plugin that may not be as easy to use compared to Woosidebars.

        Appreciate one or two pointers! :)

        Cheers!

  • Michael

    Zoe: The Widget Logic plug-in will do what you want.

  • Christopher

    Hello,

    I purchased groups for woocommerce. I noticed when a user tries to access a page that they do not have the right permissions for (enforcing access restrictions), groups just sends them to a 404 page. Is there a way to forward the person to a custom URL instead?

    It would be used to allow them to purchase a relevant membership for proper access. I’m comfortable doing some PHP editing if you could point me in the right direction, or if there’s a better way of going about this, let me know.

    Thanks for the plugin!

  • Hi
    We are protecting content in a CPT. For testing we have set up a dummy post as follows.

    [groups_non_member group="Registered"]
    The content you are trying to view is members only
    If you are a member, please use the form below and log in.
    [gravityform id="3" name="Login" description="false"]
    If you would like to become a member, please register using the form below.
    [gravityform id="4" name="Member Registration" description="false"]
    [/groups_non_member]

    [groups_member group="member"]
    Lorem ipsum dolor
    [/groups_member]

    When viewing the post as a member to the member group, I see the Lorem ipsum. But when fully logged out, the page is a 404.

    I need users who are not logged in, or, users who aren’t registered at all, to the site to see the message inside the [groups_non_member] shortcodes.

    Does the plugin not function in this way?

    Thanks
    Iggi

    • That’s all correct, the page is protected through the access restriction (top right when editing the page). Anyhow, in that case you don’t need to restrict access to the whole page, because you’re protecting parts of content with the shortcodes. So you can simply uncheck the access restriction for the whole page and leave the shortcodes.

  • Mulegoat

    Hi Kento,

    I am currently researching plugins such as yours for a client who wants to have a means to deliver video – via a page or post to his workforce (about 200 or so staff). Most staff would be accessing the content on a mobile platform (mainly iOS 4.0 and above). I was very encouraged to see that content is hidden from Search engines (one of the main client requests), however I’d like to know if the following capabilities exist, or are possible in some future / custom development.

    1. User confirmation action
    This would specifically involve the user clicking a button to confirm the content was viewed / understood. Note – I know this is easy to add via forms or a javascript popup – however it would be helpful if such data was available in the admin panel which leads to the next requirement

    2. Admin Tracking
    So when admin publishes the Group specific content they can track to see users who have a) Not viewed the content or b) Viewed but not understood the content.

    do you think our use case would suit your plugin?

    Many thanks in advance

    • Basically I would say yes, content delivery can be controlled and the confirmation and tracking would involve some custom components.

  • I run a site for a choir. We would like to set up groups (different voice parts, patrons, sponsors, etc.) and be able to email different groups (not Roles). Any ETA on your development of group email capability please? Seems like a popular request.

    • Work is being done to provide a messaging framework for Groups which includes support for group emails. Can’t give an ETA yet though, it also depends on sponsor’s requirements and funding.

  • Dan Feeley

    Greetings,

    Before I install and start testing with this plugin I have, hopefully, what will amount to an easy question. Does the groups plugin provide any form of user approval process? Meaning if someone signs up for an account can they be put into a waiting state before they are assigned an appropriate group and further granted access to the site? Comments anyone? Thanks!

  • sue

    a dumb question.. I’ve installed this plugin and activated it but I don’t see anything on how to use it. How do I add members to the group?

  • AJM

    Hi Kento,

    If an unregistered user attempts to access a post or page that is restricted they get redirected to the WP 404 page. Is there a way to have it redirect to a different page? Say one that says: You must be signed in to view that content, click here to create your account.

    Great plugin by the way. I’m enjoying setting it up and learning how to use it.

    Thanks,
    AJM

    • Hey AJM, I’ll add that to the list of feature requests. Makes perfect sense and, judging from previous comments, would be welcome to others as well.

      • Dan Feeley

        I too have been waiting for this redirect feature. Has it made it into the product? If so, how do you set it?

        • Actually after reconsidering if this should really be added as a feature, I’d rather discard the idea as a whole. The 404 Not Found is intended and appropriate for content that is protected – just don’t reveal why you refuse the request and thus don’t give any clues to whether there is something to protect or not.

          • Travis

            Please don’t discard this idea – the point is that the control be put into the administrators hands. I’m planning to hack the plugin to change the behavior.
            If you reconsider, here’s my proposal:
            Create user options for the plugin to choose the behavior when a visitor reaches a access controlled page and is either (a) not logged in, or (b) logged in but not permitted to access. For either case, allow the administrator to specify the redirection to (a) 404, (b) Login or (c) custom URL.

  • Ty

    I have just bought the wpmu membership plugin and am looking for a plugin that will let me create an account for a whole school district (a group) as one user. In essence what I want to do is when any individual from the school district logs in to my site, they all log into the same account -but they are unable to access the account details like email, etc…
    Is this plugin able to do that?
    Thanks

    • You can use Groups to restrict access to content etc. but the user account stuff is a different thing. If people are able to log in, they can also access the user profile page and change things there unless you use a mechanism that would inhibit this. But frankly, having lots of people log in through a single account sounds like a bad idea anyway. Rather than trying to do that, I’d suggest you simply create a group and let users access content based on whether they belong to that group.

  • Ty

    Thanks for the input! I can see why it would be a bad idea, but:

    Is there a way to add people to a group automatically based on some kind of code they input?

    I don’t really understand the ‘capabilities’section. Does this section allow the things listed, or restrict them? Is there documentation on each one somewhere?

  • Jason

    I would love to see a extension (premium if the market would bear) that would integrate auto-response email providers with the groups. AWeber, MailChimp and WP Responder come to mind. Having logic to determine what would add a user to a given group and what would remove them from a give group would be ideal. Not sure if this is the best place to post feature requests, but thought I would pass it along.

    • Thanks for the suggestion Jason, I would say there certainly is a market for such extensions. GetResponse is another interesting provider and they are developer-friendly. Those integrations are often made possible because someone (organization or individual) funds their development and, as with other integrations that I’ve provided, I’m open to cooperate and welcome specific feature requests. Is there a specific provider you would like to see integrated with Groups?

    • antonio

      Hi,
      you can take a look to Groups2MailChimp.
      cheers

  • Does this support dripping content? Limiting access by # of days since starting in a new role?

  • Kelechi

    Hi Kento

    I’m having problems getting the button to display for [groups_join].

    The following shortcode displays the message, ‘You are a member of the Registered Group’ for members, but non-members/visitors not logged in, nothing is output at all:
    [groups_join group="Heat Premium Member" submit_text="Join now" display_is_member="true"]

    I have the same problem with the [groups_leave] shortcode. It also only displays to those already logged in. is this the how it is supposed to work?

    I want to have a button where new site visitors (who are not logged in) can join one of the groups. Is this possible?

    Thanks

  • This is a great plugin. Started using it couple of days back. However I am stuck with something here. How to restrict access to multiple groups with shortcodes?
    I tried using

    [groups_non_member group="A" group="B"]
    ——–content———-
    [/groups_non_member]

    [groups_non_member group="A"]
    [groups_non_member group="B"]
    ——–content———-
    [/groups_non_member]
    [/groups_non_member]

    both didn’t work. Expecting a rapid response. Thank u.

    • [groups_non_member group="A,B"]
      Shown if not a member of A or B.
      [/groups_non_member]

      • Thank you for the reply. Will definitely try it out.

      • Thanks it works. But it did not work as I expected. I use the shortcodes to enable a user to join one of the three groups.

        [groups_non_member group="A,B,C"]
        [groups_join group="A"]
        [groups_join group="B"]
        [groups_join group="C"]
        [/groups_non_member]

        It displays good. When a user clicks on a button, the page refreshes and that specific button goes away but the other buttons stay on their place. Only after another refresh, the other buttons hide.Is there a way to make all buttons hide after clicking on one button.
        Thanks in advance.

        • This is due to how the nested shortcodes are evaluated, when the groups_non_member shortcode is evaluated, the user who has clicked the button to join group A is not yet a member of that group, then when the join button for group A is evaluated, the user is added to that group and the other buttons are rendered as well.
          Simple solution: surround each join button by the groups_non_member button with the three groups in the attribute.

          • I have tried that already. I did try it again after you suggested it. But unfortunately, it dintn’t turn out well. The output differs for different selections.
            eg: when clicking A, it seems to works
            when clicking B, A stays.
            when clicking c, A and B stays.

            Any other solution? Thanks.

            • Try it like this, that works:

              [groups_non_member group="Premium,Advanced"]
              [groups_join group="Premium"]
              [/groups_non_member]

              [groups_non_member group="Premium,Advanced"]
              [groups_join group="Advanced"]
              [/groups_non_member]

              [groups_leave group="Premium"]
              [groups_leave group="Advanced"]

  • Steven Holland

    Hi there
    I notice that one of the capabilities is: view_woocommerce_reports.
    Does this enable me to create a user group that has access to viewing the reports section of woocommerce?
    I will be acting on behalf of a number of merchants and would like to give them access to the sales made on their behalf off my site as shown in this report.
    Thanks
    Steven

    • Yes that would be possible, with that capability added to a group, users in that group could access the reports admin section directly http://example.com/wp-admin/admin.php?page=woocommerce_reports
      The only problem with that is, to be allowed access to the WooCommerce menu, they also need the manage_woocommerce capability, otherwise it would be a bit confusing as the menu appears but when they click on it they get ‘You do not have sufficient permissions to access this page.’

      • Steven Holland

        Thanks for your response.
        I do not want to provide total access to woocommerce to this group, just the reports. This may not work for me.

  • Kelechi

    This plugin could potentially solve a huge problem for me, especialy when I make use of your woocommerce groups plugin as well. Awesome work! There is just one small thing that I’m stuck on:

    I’m having problems getting the button to display for [groups_join] and [groups_leave] for non-logged in/new visitors to the site. Nothing is output at all using this shortcode for example:

    [groups_join group="Heat Premium Member" submit_text="Join now" display_is_member="true"]

    Logged in members it outputs: ‘You are a member of the Heat Premium Member Group’
    For new visitors (not logged in) it outputs nothing. No button is displayed.

    I want to have a button where new site visitors (who are not logged in) can join one of the groups. Is this possible?

    Here is my test page: http://surreyheat.com/test-premium-content-page/

    Please please help!

    • To be able to join a group you need a user account and log in with that account. Once the user has logged in, the buttons will appear and allow to join the group.

  • This is a great script however, I need some help. This is what I’m trying to do:

    [groups_non_member]
    Products Guests
    [/groups_non_member]

    [groups_member group="Registered"]
    Products Members
    [/groups_member]

    I want groups_non_member to show for GUESTS ONLY, it shows for guests and for members, how can I get around this? I want my guests to see guest prices and my members to see member prices, not my member to see both.

    • You need to provide the group attribute on the first shortcode.

      • Sam

        Not sure what you mean by group attribute on the shortcode.
        I need to display content on pages and posts to non-registered users only and this shortcode does not do that.
        [groups_non_member]
        Content for non-registered users only.
        [/groups_non_member]

        • antonio

          Hi Sam,
          with “group” attribute you can restrict access.
          You can see an example here.
          cheers

          • Sam

            I do not see any documentation allowing default “guest” groups for non-registered users. Is it possible with the Groups plugin to allow a visitor to the site, who has not yet registered, to view content that is restricted from premium groups (“to view content, please register”). By using the restrict method, that would mean each time that a new premium group is added, the shortcode will need to be updated to include the new premium group to restrict. That seems counterintuitive.

            • antonio

              Hi,
              you can use for example:
              [groups_non_member group="Registered"]bla bla bla [/groups_non_member]

              cheers

  • Hey, can you tell me how to find out what group a member belongs to in a template? e.g. the php code, like $groups=$current_user['groups']

  • I found it further up, it’s:

    $user = new Groups_User( $currentUser->ID );
    $groups = $user->groups;

    This returns an array of group objects. However, this is a bit messy for my purposes because I just want to know if they are member of a group.

    Is there anyway to check if a user is a member of a group in the template? Ideally I’d like to use the shortcode [groups_member group=”Registered”]my php code here[/groups_member], but this isn’t proving possible in the template whilst retaining legibility. So I tried the API and found the function groups_member, then realised that this is used for the shortcode.

    • Voilà :)

      $user_id = ...;
      $group = Groups_Group::read_by_name( 'Registered' );
      if ( Groups_User_Group::read( $user_id, $group->group_id ) ) {
      // do stuff
      }

      • Jaybe

        Attempting to leverage this in functions.php for the purposes of filtering navigation menus for logged in users (correct- to filter out menus for registered and logged in users; e.g. only anonymous should see those menu items).

        Do I need to call a global first in order to leverage the API?

        Code as follows:

        [code]
        function wpse31748_exclude_menu_items( $items, $menu, $args ) {
        $user_id = get_current_user_id();
        $group_id = Groups_Group::read_by_name( 'Registered' );
        // Iterate over the items to search and destroy
        foreach ( $items as $key => $item ) {
        if ( ( $item->object_id == 15 ) && ( Groups_User_Group::read( $user_id, $group_id ) ) ) unset( $items[$key] );
        }

        return $items;
        }

        add_filter( 'wp_get_nav_menu_items', 'wpse31748_exclude_menu_items', null, 3 );
        [/code]

        * For reference, object_id 15 is an example of a page_id to unset.

        • The code (now corrected) had an error, you would use:

          $user_id = get_current_user_id();
          $group = Groups_Group::read_by_name( 'Registered' );

          And don’t do Groups_Group::read_by_name(...) on each iteration with the same parameters, just check if ( ... && $group ) ....

  • [groups_non_member group="student,professional,enterprise"]

    [groups_join group="Student" submit_text="Student" display_message="false"]

    [/groups_non_member]

    [groups_non_member group="student,professional,enterprise"]

    [groups_join group="Professional" submit_text="Professional" display_message="false"]

    [/groups_non_member]

    [groups_non_member group="student,professional,enterprise"]

    [groups_join group="Enterprise" submit_text="Enterprise" display_message="false"]

    [/groups_non_member]

    This is how I tried and the problem was as I mentioned it.

  • is it possible to change the default group name Registered to lowercase ‘registered’?

  • I changed everything to lowercase and the result is still the same.

    Also please note that, this comment threat is the continuation of my previous comments. That gives u an idea of what my problems are.

    • Hm, if that doesn’t work for you then I guess that either there’s a conflict or how it behaves is different from how you expect it to. If the latter is the case, there’s not much you can do about it, as that’s how it is designed to work.

  • Thanks for that solution, and thanks Nicole, I will use that within my templates as well. I was just about to ask that.

  • Okay so I’m confused, I have two Groups. Free Members and Premium Members. When they sign up, this automatically assigns registered users to group “Free Members”. If a customer signs up for a subscription, they automatically go to the role Subscription. How do I get subscription to link to GROUP PAID MEMBER automatically?

  • Some weeks ago I felt the need for the website I administer to provide the registration and group membership, and I found that Groups could help me, and indeed it did!. So thank you very much for this plug in.
    My site is in spanish. Is there any spanish translation already available?. Otherwise I could help doing it, but I do not know whether using poedit to create the ES-es.po file would be enough. Any help?

    • Thanks for your feedback, great to hear it helped you. Regarding the translation, you’re welcome to provide the Spanish translation (there is none of yet), please use this pot file groups-1.2.4.pot from which you can create the translation file with poedit.

      • Hi,

        I put the files with the spanish translation in

        https://www.dropbox.com/sh/dtx2zmayvnvlkww/QMDpxlHrbX

        I have tested them in my site and it works!. Nevertheless I have observed the following:

        1) This message does not appear in spanish, though I have included the translation:
        Thank you for using the Groups plugin by itthinx.
        Gracias por usar el pug in Groups de itthinx.

        2) The same happens with “Access restrictions”, probably because the english version in the .mo file shows “Access restrictions”, whereas in the web page it reads “Access resticions”

        3) There are somo words or sentences that are missing in the original text file and I do not know to to add them:
        – Include these capabilities to enforce read access on posts. The selected capabilities will be offered to restrict access to posts.
        - Contribute
        - Delete all Groups plugin data on deactivation
        Best regards

  • Akmal Izzat

    Is there a manual on how to use it? I’m quite confused right now

  • Meayen

    Hello everyone, I love this plugin almost works perfectly.

    Scenario 1: Created Capability called read_leaders, set up a Leadership Group, added read_leaders capability to that group, made a Leadership Page and in access restrictions I saw two things: groups_read_post and the one I created read_leaders. Page works great.

    Scenario 2: Created Capability read_officers, created group added the capability to the group, created page and access restrictions only shows groups_read_post and the original read_leaders. No read_officers there at all. It does exist in capabilities when I use filters #69 so I know it is available.

    Can someone please help me solve this issue, many thanks in advanced.

    Meayen

  • I’m looking to woocommerce and groups to use for membership site using buddypress. I’ve tested this with not much success. Groups does remove the menu item from the navbar, bu when I type in the slug it permits access to the buddypress page (members, groups, forums, and activity).

    • I haven’t tested it with BP but if these are accessible (and assuming you are not logged in as an admin with access control override enabled), then I would guess that BP uses its own way to control access to the pages and Groups is shut out of the loop. I can only guess though, still have it in my plans to test things with BP but other priorities won’t allow me to (yet ;) ).

  • Peter Willis

    Hi,

    Plugin was exactly what we needed. I was wondering if it was possible to have the “Assign Groups” option available on “Add User” page?

    Peter

    • Hi Peter, many thanks for your feedback. This sounds like a good idea, I’m only wondering whether to take something like that into the plugin’s core or rather as an additional plugin. I’d like to keep the footprint it makes OOTB on the admin sections as light as possible.

  • Keith

    Fresh install of WordPress 3.4.2 and Groups plugin. I created one new group and it added ok. Then when I go to add another group and click Add, it does not add this second one.

  • Hey there, first let me say thansk for writing this.

    I just have a quick question:

    I need to be able to give users access to individual files from a downloads page.. e.g User ‘A’ can see/download files 1,4,2,6 … whereas User ‘B’ can see/download files 3,6,4,2…

    Is this an option using your plugins?

    Ideally I would like to be able to upload downloads, give them an ID, then assign access to this ID to specific users.

  • I am trying to allow all to see part of a post, but only “Subscribers” to view below the read more tag

    Is this possible?

    • Yes, you can use the shortcodes to wrap content that only members of the Registered group can see (all users including subscribers are in that group by default).

      • The only problem is that the theme I am using, Flashlight by Kriesi, does not allow me to wrap the content. I would like to put some text info in the post that shows to everyone, but hides the gallery to a certain group. In this theme, the gallery is handled differently than other themes. You cannot see any code in html view or visual view about the gallery. That is why I would like a shortcode to hide anything after the ‘more’ tag. Thanks-

  • @kento I’d be very interested in collaborating with you on this plugin. I have some UX enhancements planned as well as options for inheriting permissions from parents in hierarchal post types and some overall improvements for multisite and making this work very well for large sites with tons of pages and security requirements ( think Higher Education websites ).

    I did a quick search, but couldn’t find the source on github or similar services. For now I’ve created my own repo on github and will be committing my updates there.

    • Hi Lucas, sounds great, contributions are welcome. Would be interesting to know some details about what you’d like to enhance, I might also point you in the right direction for what you want to achieve. The core is held very clean and it is designed to scale well, anything you’d like to comment or ask in this respect, do let me know.

  • Matt Walsh

    I am wanting to show a different link in the template file depending on what group the user logging in is.

    I know this can be done in the post via [groups_member group="Company"] but how can Incoporate this into the actual template file e.g. the header?

  • David

    I installed the Groups plugin and think I understand how it works for posts and pages. I would like to use with the links as well, but get this error: Warning: in_array() expects parameter 2 to be array, boolean given in **removed**/wp-content/plugins/groups/lib/access/class-groups-access-meta-boxes.php on line 105. Looking into the code, it appears that $read_caps is returning empty or NULL. Am I missing something in initial setup that is causing that to be blank?

    • Thanks for mentioning this David, it’s a bug. The box probably shouldn’t even be there as links aren’t really a type of post. Will be fixed with the next release.

  • Is there any way to show user details from a certain user group? What I want to do is to create groups of users and then within a loop, if someone selects a group from the dropdown menu, I want to be able to display their name and email. Is this possible? So basically, is there a shortcode to show user information from users within a certain group??

    • I’ve done this already with roles, but my issue is the fact that I have the need to assign users to more than one group, so in this manner roles do not work. Is there some syntax that works similar to get_users(); ?

      • looking at your code, I see the experimental section regarding show=”users”. I see that in that manner, I could very well grab the users user_email by changing user_login. I think I can use that functionality to do a comparison against get_users(); and then use that to retrieve what I want.

    • Have a look at the current trunk, the users property has been added to Groups_Group. You can derive what you need from there (lib/core/class-groups-group.php) or if you want, work with the version in trunk and just use the property.

      • Can you give an example?

        I modified your shortcode file “class-groups-shortcodes.php” and added new shortcodes for retrieving specific information. Only problem with this, is that when I update the plugin this functionality gets overwritten. BUT, it works for what I need it to do.

        case ‘usersemails’ :
        $user_group_table = _groups_get_tablename( “user_group” );
        $users = $wpdb->get_results( $wpdb->prepare(
        “SELECT * FROM $wpdb->users LEFT JOIN $user_group_table ON $wpdb->users.ID = $user_group_table.user_id WHERE $user_group_table.group_id = %d”,
        Groups_Utility::id( $current_group->group_id )
        ) );
        if ( $users ) {
        foreach( $users as $user ) {
        $output = $output.$user->user_email.”;”;
        }
        }

        break;

        and then I’ve been using do shortcode and using explode to seperate into an array.

        $groupemails = do_shortcode(‘[groups_group_info group="'.$usergroup.'" show="usersemails"]‘);
        $countusers = do_shortcode(‘[groups_group_info group="'.$usergroup.'" show="count"]‘);

        $groupuseremails = explode(“;”, $groupemails);
        for ($i = 0; $i < $countusers; $i++) {
        echo $groupuseremails[$i];

        }

  • Gene

    Hi Kento,

    Is it possible to use this plugin to restrict access to certain WooCommerce products or do I also need the Groups for WooCommerce extension as well? I don’t need to sell memberships. How about restricting access to WooCommerce categories?

    Thanks!
    Gene

  • Matt

    @Kento

    I have this is my file now

    $user_id =get_current_user_id();
    $group_id = Groups_Group::read_by_name( ‘Company’ );
    if ( Groups_User_Group::read( $user_id, $group_id ) ) {
    echo ‘test’;
    }

    And I have a group called Company which a user is assigned to but when he is logged in the “test” still doesn’t show.

    • That looks ok, if it doesn’t appear the cause should be somewhere else.

      • Matt

        @kento I have tried this on a clean install of wordpress and your plugin so I think it may be a bug in the plugin can you have a look and get back to me as everything else is working perfect.

        Thanks.
        Matt.

        • Oh but there’s an error, Groups_Group::read() returns the group, not the ID, so the correct code – here for the Registered group – would be:
          $user_id = get_current_user_id();
          $group = Groups_Group::read_by_name( 'Registered' );
          if ( Groups_User_Group::read( $user_id, $group->group_id ) ) {
          echo 'Boo!';
          }

  • Hi,

    When I moved my site I now have groups that show up as ancestor and I can not delete them on the page restrictions nor do I see them in the group setup. Can you tell me how to remove them?

  • Jaybe

    First, wonderful; thank you for your evidently hard work and contribution.

    Goal:

    - Conditionally do not display menu items to registered, or greater, users.
    - e.g. only anonymous, not-registered users should see the menu item.
    - e.g. once logged in, a logged-in user would not see the “login” menu item any longer.
    – e.g. and instead may then see the “logout” menu item
    — e.g. anonymous, not-logged-in users never see the “logout” menu.

    I understand how to hide the “logout” menu, or other protected content/menus, for example, by creating a logout Page and restricting access to only group_read_post.

    However, how about the reverse? Is there [a way to have an] anonymous group specification?
    e.g. restrict this page (and therefore, menu item), to ANONYMOUS, not-registered users?

    Thanks!

  • Hi,
    I would like to add a drop down field during the registration page where the new user chooses between 3 groups and after the registration process, he gets added to that group automatically. How to do this? Please help me get through this.
    Or is there a php function that takes the user id and group id as parameters and work on job?

    Thanks.

    • Hello.. Anyone have any idea on what I am talking about? Please help me resolve the functionality I talked about in my previous comment.

      Any effort by you is appreciated.

  • kar

    Hi Kento,
    your plugin has too much…( its a compliment) really good plugin.
    if this is my requirement, what i need to do.

    1. i want to create a member’s only website, its based on templatic WPSHOP theme + woo commerce + Groups plugin.

    2. it means, i want only registered member’s (member’s must be approved by me) to access my whole website

    3. once the registered users login, i have final products and designs
    i want general buyers to see the final products, resellers to see both the final products and designs

    thanks
    Kar

    • Thanks kar :) You can assign capability X to control access to products and capability Y to designs. Use one group for resellers and assign capabilities X and Y to their group, use another group for buyers and only assign capability X to that group.

  • Scott

    Hi There,

    Is there currently anyway to list the members of a specific group? For example, I would want to show a simple list of all the members in the registered group.

    Thanks

    • Scott, I did this by revising the shortcodes php file within “lib/views/class-groups-shortcodes.php.”

      on line 96 you will see a case called “users”. By default, this gives you the user’s login and I noticed it uses the same parameters as the builtin wordpress function “get_users()”

      [groups_group_info group="registered" show="users"]

      SO what I did is I modified the shortcode class by copying and pasting that section. I added my own shortcodes for each user parameter. You can download my updated shortcode class if you want.

      http://hardwiredmedia.com/class-groups-shortcodes.zip

      and then within php, I make the calls like so:

      <?php

      $users = do_shortcode('[groups_group_info group="'.$usergroup.'" show="users"]');
      $group = do_shortcode('[groups_group_info group="'.$usergroup.'" show="usersfull"]');
      $groupemails = do_shortcode('[groups_group_info group="'.$usergroup.'" show="usersemails"]');
      $groupfirst = do_shortcode('[groups_group_info group="'.$usergroup.'" show="usersfirst"]');
      $grouplast = do_shortcode('[groups_group_info group="'.$usergroup.'" show="userslast"]');
      $grouptitle = do_shortcode('[groups_group_info group="'.$usergroup.'" show="userstitle"]');
      $countusers = do_shortcode('[groups_group_info group="'.$usergroup.'" show="count"]');

      $groupuser = explode(";", $group);
      $groupuseremails = explode(";", $groupemails);
      $groupuserfirst = explode(";", $groupfirst);
      $groupuserlast = explode(";", $grouplast);
      $groupusertitle = explode(";", $grouptitle);

      for ($i = 0; $i

      The bummer is if you update the plugin it breaks the functionality as the shortcode doc gets replaced.

    • See also @casey’s previous comment and better pack it into its own plugin to avoid hacking the plugin’s core.

      • Kento, I’m really loving your plugin. Great work. I did as you suggested and I’ve created a plugin that can be used to extend groups in the manner I listed above.
        I included usage in the readme.txt file and also provided a php example. It’s not the most sophisticated approach, but it works well.
        http://hardwiredmedia.com/extendgroup.zip
        This will keep updates to the group plugin from affecting the code I made. Thanks for the suggestion, that will make life much easier.

  • Jaybe

    Does Groups have facilities and capabilities to do global “private site” type settings?

    For example, does/will Groups protect RSS feeds, requiring Group access to read feeds?

    In summary, I’d like to be positioned to protect all available content through the various methods WordPress, default, allows and leaks, such as RSS, etc.

    Thanks; various frameworks and add-ons looking great!

    • Yes entries in feeds are protected based on the access restrictions set for entries, e.g. if a post is protected it will only show up in the feed if the viewer is logged in and has access.

  • Akmal Izzat

    Man I really hope you can restrict categories too… especially when added to the Menus..

    And it will be much easier and cooler if you can add a menu like what Membership does http://wordpress.org/extend/plugins/membership/

    I’m not promoting it, I just wanted to tell you that their Membership menu is very cool. Just drag and drop and you’re done. But too bad it doesn’t integrate with WooCommerce. And the fact that I have to pay for more than 2 groups is just unbelievable..

    Luckily I found you =D And I hope this plugin will become easier to use and better than ever..

    • Thanks for the suggestions, I’ll have a look and consider these. I can see it would be quite useful to be able to restrict for example all posts in a category instead of having to go into every post in that category and restrict it. I’m not sure if something like that should be in Groups’ core though, more opinions on this would be welcome.

      • Akmal Izzat

        I see. So is there a way for me to restrict categories to certain groups using this plugin?

        • Technically you wouldn’t really restrict a category to groups but rather restrict access to its posts based on capabilities, that’s why I mentioned that you would have to go into every post that belongs to a category – a feature that would allow you to restrict posts that belong to a category would then do that automatically.

          • Akmal Izzat

            hahah I see. I already did that and it’s quite tiring =D anyway thanks man.. luckily I didn’t have that many posts to restrict..

        • Akmal Izzat

          oops nevermind.. i think i just repeated my question again lol, please delete…

          • I think it would be really great if you added that feature. It would make it much easier to restrict lots of posts to a certain group. I also think an option for all sub-pages of a protected page to automatically be restricted to the setting of the parent page, would also be awesome. Then if you had a restricted “section” of your site, you don’t have to remember to restrict each page, just create sub-pages of the main restricted page.

            • Makes sense. Technically it would be restricting access to posts by taxonomy term – for example a certain category. I’m considering the option even more now, still not sure if it should go into the core but at least to have the option to do it seems pretty useful.

          • Austin

            Well if it’s up for discussion at all, I’d love to see it in available in the plugin core. I think it’s a logical function, especially for the use case of having menu items which link to categories that show or hide based on groups allowed to view that category.

            Right now I’m having to code this manually after discovering it didn’t already do this. I assumed it was an available feature when choosing groups.

            ** No complaining at all! Thanks for the plugin! Just giving you an example.

            • Many thanks for your feedback on that Austin, I really appreciate it.

              I’m still not sure if putting it in the core would be a good option or not – mainly because I haven’t had a chance to code and test it. In my opinion, it depends on the performance impact that would have and I’d have to test that before taking the decision.

              Would you mind sharing how you are coding it right now?

  • Hi,

    I’ve been using this plugin together with Woocommerce, Groups for Woocommerce and Events Manager plugin.

    I’m trying to set 2 groups capability to one events post but everytime I saved the post, the selected capability does not seems to being saved, even if you have saved 1 group capability before, it seems the save only removes any groups capabilities attached to that post. It won’t happen if I set only 1 capability to the post, but when selecting more then 1, then the problem occurred.

    • Just to add that any help would be appreciated.

      Thanks. :)

    • Hi Khairi,

      Here’s what I found out:

      When you try to restrict access by checking the boxes, Groups verifies (*) that you actually are allowed to do that using the current_user_can(...) function provided by WordPress. The execution flow of that function results in the map_meta_cap filter being triggered via WP_User‘s has_cap( $cap ) which invokes the map_meta_cap(...) function defined in capabilities.php.

      (*) The call through Groups_Access_Meta_Boxes::save_post(...) results in two parameters being passed to map_meta_cap(...), 'edit_event' and the current user’s ID. The third parameter that em_map_meta_cap(...) expects to be there isn’t, because it’s not about the post but just about the user.

      Events Manager hooks itself into the map_meta_cap filter and erroneously returns an empty array of capabilities for a user who tries to edit an event when the call happens in Groups_Access_Meta_Boxes::save_post(...).

      This notice is thrown out:

      Notice: Trying to get property of non-object in /var/www/wptest/wp-content/plugins/events-manager/em-posts.php on line 318

      because $post_type on that call is missing the property cap.

      Summing it up, unless Event Manager restricts what it does to only when it should apply its logic in its em_map_meta_cap(...), this is going to fail.

      If I’m dead wrong in any of the above, anyone feel free to correct me, otherwise it might be a good idea for Events Manager’s developers to try to solve this.

  • Hi Kento,

    I get these errors displayed on the website magikando.es relating issue Groups Capabilities not been added to Groups:

    Notice: Undefined property: WP_Query::$post in /usr/home/magikando.es/web/wp-includes/query.php on line 2986

    Notice: Trying to get property of non-object in /usr/home/magikando.es/web/wp-includes/query.php on line 3349

    Notice: Trying to get property of non-object in /usr/home/magikando.es/web/wp-includes/query.php on line 3351

    Notice: Trying to get property of non-object in /usr/home/magikando.es/web/wp-includes/query.php on line 3353

    I hope it helps

    Thanks
    Mario

  • Degetz

    Hi,

    Is there a way to hide posts titles in the recent comments box where a user doesn’t have the right to read the post itself?

    Thanks!

    • Actually the widget needs to respect the access rights for the comment to not show up (and I confess, my Decent Comments plugin doesn’t do it just as the default Recent Comments widget) – but it shouldn’t be too hard to derive a thing that does.

      • degetz

        I’m happy to do it, however I would need some hint where to start. To be frankly, I tried to figure out what’s need to be done, without any success.

        Thanks.

        • I would start deriving a widget from the one that comes closest to what you want to display, put it in a plugin or in your theme and use Groups_Post_Access::user_can_read_post( $post_id, $user_id = null ) to check if the current user has access to a given post. Pretty simple actually if you wrap that in an if clause :)

          • jaybe

            Sure would be nice if this worked “properly” out of the box. I enclose “properly” in quotes, because, like all things… this is subjective. It’s possible ones desires the post title be displayed within comments as a “teaser” in certain cases, perhaps.

            I wonder… if there exists a filter/hook mechanism into the standard WordPress comments display, that would alter the parsing mechanism that identifies comments to include in lists of comments and therefore pages returned.

            For instance, a block that could be added to ones functions.php to adapt native WordPress comments/posts parsing to respect Groups’ designations.

            This would alleviate having to write, and maintain, new widgets, plugins, etc. … and instead, take advantage of what in standard in WordPress through slight tweaking with through common tactics.

            Thoughts?

  • Zubat2011

    Hello I`m looking to use this Groups Plugin from here http://wordpress.org/extend/plugins/groups/ and see that the info says

    Extensions

    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 Notifications Adds customizable notifications for events related to Groups.
    Groups PayPal Groups for PayPal allows to sell memberships and subscriptions with Groups.
    Groups WooCommerce Groups for WooCommerce is a WordPress plugin that allows you to sell memberships.

    So what I would like to know is I see I should use the Groups File Access and the Groups Notifications but what should I use the….Groups PayPal or Groups WooCommerce what would be better and ease on me and members..

    And Now I have 1 more ?….I was looking at the Groups for WooCommerce and thay say Groups is a free plugin for managing memberships yes ok but I would have to get the WooCommerce Subscriptions and the Groups Integration for WooCommerce…

    So please help me deside on what would be the better choice for long term use I have WooCommerce setup and working now….So I was just saking for any info or any one have worked with them both and can tell me anything good or bad……Thank you everyone…

    • You can use Groups PayPal if you want to have a simple and quick solution to offering paid membership subscriptions, if you want to take advantage of a full store then Groups WooCommerce would be appropriate. For paid memberships, Groups PayPal supports one-time payments as well as subscriptions, Groups WooCommerce supports one-time payments but if you want to handle subscriptions you also need the Subscriptions extension for WooCommerce. The next release of Groups WooCommerce will have an option to limit membership to a certain amount of time, with that you will have an intermediate solution between one-time payments and subscriptions for paid memberships.

  • “The next release of Groups WooCommerce will have an option to limit membership to a certain amount of time”

    That is exactly what we need… looking forward to the next release :)

  • How can I use Groups to restrict post access on a subscription membership site, but still have the featured images from the restricted posts show up to non-members on my homepage? Thanks!

    • Couldn’t you wrap the template content and leave the featured image unwrapped?

      ID ) ): ?>
      ID ), ‘single-post-thumbnail’ ); ?>
      <a href="” title=””><img src="”>

      <a href="” title=””>

  • I think I understand, but where would that code be inserted?

  • Jonna Tärneberg

    Hi,

    Question: If a page has a restriction for only a group and the page is published. How do I make the page visible to all in the frontend? For example in the menu?
    The pages should still be restricted in the admin backend but once a user/author press the publish-button then it should be visible to all in the frontend.

    Thank you for a great plugin!

    • Hi Jonna, you can place a custom link to the page under Appearance > Menus.

      • Jonna Tärneberg

        Hi again!
        Thanks for the replay. I tried that but I get a 404 error when I’m logged out and trying to view the page. What is it that I’m doing wrong? Is there any check in your plugin in the frontend when viewing pages?

        I have one custom restriction added to the page.

        Another question. Can the Access metabox on posts/pages only be showed to administrators? Is this something you set in your plugin?

  • iKevin

    Hello,

    I apologize if this question has already been answered…

    I have a multisite with 4 subdomains and a master domain:

    -site.com
    -one.site.com
    -two.site.com
    -three.site.com
    -four.site.com

    I’m trying to restrict access to specific subdomains based on groups. for example, ‘Group1′ should only have viewing/login access to ‘one.site.com’ and not be able to view other subdomains. I would also like to redirect them to a specific page if they’re trying to access a subdomain they don’t have permission for.

    Also, do I need to create only the group that should have access to that particular subdomain? For example, I only create ‘Group1′ on ‘one.site.com’, ‘Group2′ on two.site.com’, etc. I assume I would need to create all ‘Groups’ on the master website (site.com) as well?

    Thank you in advance for your help!

    Kevin

    • iKevin

      UPDATE:

      I think I found the answers to most of my questions. :)

      I would still like to know if it’s possible to restrict someone from reaching an entire subdomain. Even if it’s just a 404.

    • Hi Kevin,
      It would be interesting to know what approach you are using to this. Would you mind explaining briefly how you have solved it? Could be of help for others …
      To restrict access to a whole subdomain, the first thing I can think of (not necessarily the best solution): you could use the API to test whether a visitor is a member of a group that is allowed to access the subdomain before the pages for that subsite are rendered, and if not, throw the 404 …

  • iKevin

    I offer 4 services for my business: PPC Advertising, Local Business Optimization (LBO), Web Development, and Product Photography. Some clients purchase more than one service. For example, most clients who purchase a website also do LBO and/or Photography.

    The reason I created subdomains for each service is because I’m building a dashboard for each one for clients to keep track of the progress, get the right support, and so on. So I needed a way for clients to only have access to their purchased service(s).

    So I created another subdomain, called “Launchpad” (launchpad.omnoogle.com). This subdomain only has 4 links, one for each service. Similar to the Basecamp launchpad (launchpad.37signals.com). On the Launchpad I placed a WordPress login form inside a [groups_non_member] shortcode. I also place links for each subdomain (PPC, LBO, Web Dev & Photography) within a [groups_member] shortcode, but for each link I define their respective group:

    [groups_member group="AdWords Client"]link[/groups_member]
    [groups_member group="LBO Client"]link[/groups_member]
    [groups_member group="Website Client"]link[/groups_member]
    [groups_member group="Photography Client"]link[/groups_member]

    So, when a client goes to the launchpad, they login and are redirected to the same page which now shows only the links to the subdomains which they purchased a service for.

    Now I only have 1 problem: How to redirected them back to the Launchpad after logging out.

    If anybody knows how to do this, please share. :)

  • iKevin

    Never mind about the logout redirect. I found a nice little plugin here.

  • dslayton

    I’m building a site where a group is associated with a blog post. Memers can subscribe to multiple groups… which will give them access to those corresponding blog posts.

    I want to set up a “My Account” page where members can see which groups (blog posts) they are subscribed to and then click on the group name which leads them to the associated blog post. Is there a shortcode that I can drop into the “My Account Page” to accomplish this?

    • You would have to code that: Take a group, check its capabilities, see which of them are used for restricting access to posts (or other content types, filter by type if necessary), then obtain those posts that are restricted by these capabilities – see Groups_Post_Access::get_read_post_capabilities( $post_id ) to see which post meta is used. Then echo out a link to the related post(s).

      • dslayton

        Thanks for the update kento.

        Unfortunately, I’m not a coder, and it sounds like a 3 to 4 step process for every new post/group I add… so I’m wondering… Does the new “Subscriptions” extension for Jigoshop automate any of this?

        In your opinion… do you recommend I continue down this path… or is this project better suited to a membership plugin that has pay per post and a “My Account” page that will output the desired user view?

        Thanks again for your help.

  • Estella Vidal

    is there any shortcode to display the “User Name” and “Email” from members?

    • I made a plugin extension to groups (based off of Kento’s shortcode file) that allows you to do this. Its not the best solution, but if your familiar with php at all you should be able to modify it and make use of it:

      http://hardwiredmedia.com/extendgroup.zip

      • Thank you so much for sharing your work on this Casey, I’ve wanted to reply earlier but haven’t had a chance to decently say thank you. So I’m doing it now :) Your plugin looks good from what I can say BTW ;)

        • Thanks Kento. I figured I put in the time and others would probably find it useful, so why not share it as you have done. I appreciate good developments like this that make my life easier. The second version I included below is probably a bit more useful as you can then use the shortcode without using php:.

          [groups_group_userdetails group="registered" show="users"]
          [groups_group_userdetails group="registered" show="usersfull"]
          [groups_group_userdetails group="registered" show="usersemails"]
          [groups_group_userdetails group="registered" show="usersfirst"]
          [groups_group_userdetails group="registered" show="userslast"]
          [groups_group_userdetails group="registered" show="userstitle"]
          [groups_group_userdetails group="registered" show="count"]

      • Also keep in mind the shortcode spits out a long string separated by semi-colons so in order to get it to display correctly you will have to modify my method in the shortcode, or you can use the provided “extendgrouptest.php” file. You could modify lines 24-32 to add on a and element to make it a bulleted list pretty easily. I had very specific intentions with the way I used it to create a dropdown checkbox form, so you may need to hack it to get it to work the way you want… in fact, while writing this I prepared a different version that will probably fit most people’s needs better. It’s located at:

        http://hardwiredmedia.com/extendgroupVer2.zip

        • Well, since I made some updates, I better tell her what all this does:
          The extend plugin will pull from the specified group in the shortcode, and it wraps the list in an html unordered list with list items.

          The shortcodes are as follows:

          Pulls from user_login:
          [groups_group_userdetails group="registered" show="users"]

          Full name:
          [groups_group_userdetails group="registered" show="usersfull"]

          Users email:
          [groups_group_userdetails group="registered" show="usersemails"]

          Users Full name and Email (with mailto link):
          [groups_group_userdetails group="registered" show="usersfullandemail"]

          Users First Name
          [groups_group_userdetails group="registered" show="usersfirst"]

          Users Last Name
          [groups_group_userdetails group="registered" show="userslast"]

          Users Display Name
          [groups_group_userdetails group="registered" show="userstitle"] (display name)

          Total users in a group:
          [groups_group_userdetails group="registered" show="count"]

          • Estella Vidal

            Amazing! thank you very much @caseyctg!

            What about shortcodes to display the user name and email for single/login member @kento?

  • dc

    Hi – is there a way to limit simultaneous logins with the same password/username? If not, is there a plugin you can recommend that could work with this one? Many thanks

  • I’m having trouble getting your shortcode to print in my comments section. I want it to show the commenter’s group name, but it’s not showing the group. Everything else is working. Here is my code from the site:

    user_id;
    $role = ( isset( $roles[$user_id] ) ? $roles[$user_id] : ” );
    ?>

     redeemed special from

  • Hi

    I can’t make “the content visibility for members and non-members” work. Nothing shows up. To be absolutely sure, I’ve even used your example ([groups_member group=”Registered”] etc).

    Using WP 3.4.2.

  • Jody

    I have a blog that is used for education and there are posts I want to assign for view and making comments to GROUP1 and other posts I want to assign to GROUP2. Neighter group should be able to see or access the posts from the other group. So that the blog home page only shows a list of posts that particular group has access too.

    Is that possible with your plugin. If so I am having a challenge warping my head around just how to accomplish that. Please help!

    • Create a capability for each, assign the capability to its corresponding group, enable the capabilities for access restriction in Groups’ options and check the capability on the posts you want to restrict access to.

  • onomiko

    Hi. I’m not quite sure how to ask for support so I’m posting here and here. I don’t mean to be annoying so pls only respond where you like.

    I’ve successfully allowed access to a url with the Groups plugin. The page loads for a member of that group but none of the associated files (CSS, .js, etc.) are loading on that page. Not sure what I did wrong.

    The page uses a custom page template and loads well for my admin account but not for a group memeber’s admin account.

    Thank you.

  • onomiko

    What I was doing wrong was using relative paths in the head to call my styleshees and js files. This plugin needs absolute paths for some reason. Seems to work now.

  • Brenda

    Hi I’m have a bit of a problem assigning capabilities. I have 4 groups I need to assign to my website they are different customer levels retail, wholesale, etc. I do not want my customers to be able to see the pricing structure for the other groups. How do I do that? Sorry I have not been successful in my fumbling around thought I’d ask for professional help. Any help would be greatly appreciated.

    • You grant exclusive access by assigning a separate capability for each group. Group A gets capability X, Group B gets capability Y, etc. and in Groups > Options you enable these for access restriction if you want to protect individual posts.

  • ajm

    Just a FYI, I just updated a development installation to WP3.5 and tried the latest groups plugin on it and had some errors.

  • Cedric

    Hello, it looks like your plugin Groups is not compatible with the newest version of WordPress Version 3.5. When do you plan on updating the plugin?

    Thanks!

  • I posted on the WP.org support forum for this plugin, but was supposed to post here I guess: http://wordpress.org/support/topic/error-when-using-hatch-theme

    Basically I’m getting an error at the top of the theme’s settings page. It appears to conflict with Groups. The author of the theme is claiming it’s a problem with Groups, and not the theme: http://wordpress.org/support/topic/conflicts-with-other-plugins

    Any help would be appreciated.

  • I was finally able to figure out the capabilities, I didn’t get a answer so hopefully you can help me out this time though.

    I have 3 groups w/capabilities assigned lets call them 1, 2, and 3
    I would like anyone that comes to my site to see my retail pricing they do not have to be logged in. I created a group called wholesale (2) but when they are logged in they also see the retail prices (1). They should only at that point see their pricing. Did I do something wrong?

  • jeroen

    Testtng the Groups plugin. Can’t figure out how to give a specific group the rights to view a specific page. So only one group to have access to that very page and for other visitors not accessible. The groups_read_post capability gives all the groups access who have that capability. Cab I narrow that done to just one group?

  • jeroen

    Additionally. This goes for the menu item of the page and not it’s content. I understand there’s a shortcode to show/hide content for specific groups. thanks.

  • Keith

    How can I hide the ‘Groups’ menu item in the left side menu from all users except for admins?

  • iKevin

    Hello,

    I’m getting this error when I try to update the Groups Subscriptions plugin:

    “The package could not be installed. PCLZIP_ERR_BAD_FORMAT (-10) : Unable to find End of Central Dir Record signature”

    I’m posting it on here because the captcha form on the Groups Subscription page doesn’t work (keeps telling me I’m giving the incorrect answer), so I’m not able to leave any comments.

  • hi
    i wanna use your plugin and have a question:
    Is it possible to define restrictions for a specified page (eg: articles page) that every anonymous visitor can see the intro section of article in this page , but the full article just be shown to registered users?
    tnx
    Hamid

  • Mack

    I have one page that I want blocked from non registered customers. If they purchase a product, they become “Registered” I believe I have the page blocked from non buyers and readable from buyers (Registered)

    Right now, if the visitor is blocked, they receive a 404 error. How can I direct them to a sales page???

  • Liking the plugin more and more as I become more familiar with it. Have one stumbling block. How can I display group members on a page?

    Thank you in advance for your assistance.

    ~Respect

    RevKev

    • Thanks RevKev, it’s great to see it put to good use :)
      For example: [groups_group_info group="Registered" show="users"] would show a list of registered users.

  • shawn

    well it’s been almost a year, figured I would check back to see if #1 ever made it into the plugin.
    http://www.itthinx.com/plugins/groups/#comment-477

    *protecting an entire blog via group access…

    • There’s no default option to do that yet, although basically you could write a little plugin that automatically sets an access restriction on new posts published (or I could add the option to apply access restrictions by default to Groups … hmmm).

      • shawn

        I currently use amember which has this option ‘protect the entire blog’ where it is very simple to protect an entire blog. The only thing I don’t like about amember is that it is a separate system, even though the integration is very good.

        The concept of how amember works is pretty simple, you create a custom group and then the new blog only shows up to that group. So when a user purchases a product they are added to that custom group, thus giving them permission to access that blog.

        This allows me to have an unlimited number of groups, each group has its own blog assigned to it with all content automatically protected.

        Like I said, it would just be nice to have an admin that is a true WordPress plugin vs. an external script. It seems your script is very close to being able to do this.

        My entire idea is a user purchases product ‘abc’ is added to group ‘abc’ thus they get access to the product ‘abc’ support blog. Same goes if a user purchases product ‘xyz’, becomes member of group ‘xyz’ and has access to blog ‘xyz’.

        The idea being able to have dedicated support websites on a per product purchased basis.

        • Ok thanks for explaining that, so the basic idea is to have a support area for members of a group? It’s funny, because I’m working on a new extension called Groups Forums right now :) It’s not exactly the same as you describe, but provides Forums that can be linked to groups where e.g. only group members can post a topic or reply to a topic based on their group membership.

  • Damien

    Hi,
    Your plugin is perfect !
    But i have a question : i use FastSpring to sell my product. FastSpring give me the possibility to execute a script (php or what i want, on their server) when the user has finished buying the product.
    My question is simple : it is possible to execute a script (external script, on FastSpring) which create the user (and a random password) automatically ?
    I don’t know what is the best way to automate this process.

    Thank you.

    • Thanks :)
      Have you had a look at FastSpring on GitHub? You would need to communicate with the site where you want the new users to be created, it’s not specific to Groups, rather a question of having your site receiving authenticated requests to create user accounts (and then assign them to groups if needed).

  • Holly Chervnsik

    Is there a way to group the files into folders? I’m using this for a company that has many files to manage, and I don’t want the users to have to scroll through all the documents to browse for what they need.

  • Alex Wolk

    Is there a way to sync group memberships with roles in WP? I’m using the woosubscriptions and it would be nice to use roles with other plugins that don’t support groups

    • It’s a different paradigm, Groups is designed to overcome some of the limitations that the model based on roles has. Of course one could create something that maps roles and groups, but I’m not sure that would make sense within the context you are working with.

  • Richard

    Been trying out your plugin which is awesome.
    I’ve run into a problem when it comes to handling pagination.
    The pagination seem to be based on posts regardless of access. Example result: when I list posts the first page may be empty, while others may have 1,2,3 or more items.

    I found:
    public static function the_posts( $posts, $query ) {}

    But for some reason it doesn’t seem to trigger. Not really skilled enough in my scripting to debug where things go wrong. Any advice?

    • Thanks Richard, it’s always good to hear that :)
      The function you refer to filters out posts that the current user is not allowed to see. It sounds like the pagination you are using does not take the actual number of posts into account?

  • Alex Wolk

    Hello, I recently posted about groups breaking the mail press plugin. I’m so desperate I would be willing to pay you to fix the bug. Thanks again

  • Hi,

    I installed your plugin but I do not understand it. I have 4 pages that I want to restrict to a members group.

    Let’s say “Subscriber” group within WordPress. How do i assign access from the “Subscriber” member group to these 4 pages only?

    Thank you for help.

    • You can follow the instructions as explained for example here (only steps #2 and #4 apply).

      • Hi Kento,

        Thanks so much for the quick reply. I followed steps #2 and #4. One more question. How do I assign members to get access to the group I created in the steps? I go to users in WordPress and the group I created does not show up there.

        Thanks again,

        John

        • Hi John,
          You can assign them manually from the normal Users section in the admin area – new groups appear in the dropdown on top of the table.
          Cheers

          • Sorry I am not following you. Where is the normal section? Do you mean WordPress users? Under wordpress users the new group I added with your plugin does not appear under user “Roles”. So I do not get it where to add someone. All seems very vague.

            • No, it isn’t vague at all, but groups and roles are different things and you should not expect a group to appear as a role. On top of the Users table there is a facility to add or remove users from groups – nothing to do with roles. If that doesn’t appear in your setup, then there is something wrong with it.

          • How do i get to the users table? I do not see it.

          • Okay i do not see it. Appreciate your help. I uninstalled it and installed UAM user access manager and got it setup in less than 3 minutes and working so i guess this plugin is just too complicated for what i need. Thanks again for your help.

  • Please, tell me: How do i completely remove all traces from this plugin in my multisite install? Simply deactivating and removing the plugin did not do the trick.

    I think most of it is gone now, but in my main blog option table I find the row “groups_options” – does this belong to the plugin?
    I guess this does: groups_plugin_version

    Further: Do this plugin leave any settings inside each OPTION table –>user_roles in wordpress? If so, how do I identify and disable this?

    • For a single site Groups > Options has an option to delete all plugin data, and in the Network Admin an option under Groups.

      • But I have removed the plugin and deleted the obvious tables in my database manually. But I think some settings still are there, somewhere.
        Do you say that I should re-install the plugin to un-install all settings and data?

        • No, if you have manually modified the database or table data (which you shouldn’t have) then it’s probably best to delete remnants manually as well. Make sure to back up your site before doing more modifications.

          • Ok, but I need to know: has this plugin changed anything vital inside the different blogs OPTIONS table (for example user_roles) ? Something that might affect blog/user settings? I have a odd issue with my sites comments: despite the fact that all sites are set to auto approve comments from logged in and registered users, all comments are withheld for moderation. Can this be an effect from the remains from this plugin?

  • Courtney

    Hello,

    I installed your Groups plugin for the WordPress website that I am creating, and first of all nice work. It works very smoothly and is just what I have been looking for. Where can I go to donate?

    There is only one thing that I would like to do differently, and I would appreciate your advice on how I should accomplish it. Normally the Groups plugin causes an error to be displayed when a restricted page is referenced. When the appropriate user logs in, the page displays normally in both the navigation and through a direct link. Is there any way that I could send the user to a login page rather than an error page?

    Thank you very much.

    • Hi Courtney,

      Many thanks, it’s always good to hear it is appreciated :)

      After considering that this is not the first request for an alternative to the 404′s, I’ve taken the time to write a plugin that allows to redirect to another page or to the login page. You can download the plugin Groups 404 Redirect.

      As for donations and collaboration, you’re more than welcome to get in touch or contribute by using any of the premium extensions, by leaving a good review or whatever nice things come to your mind ;)

      Thanks for using Groups!

  • Hi, just a question. As mentioned I uninstalled groups from my multisite, and want to clean my db.

    In my “options”-table I find these rows:

    group_options
    with this value: a:1:{s:7:”general”;a:1:{s:22:”read_post_capabilities”;a:1:{i:0;s:16:”groups_read_post”;}}}

    And:
    gropus_plugin_version with 1.3.2

    Can I delte these two rows?

    • Make a backup of your database before you do any deletions just in case, then, if you’re not going to use groups you can delete these rows.

  • Damien

    Hi,
    I have a little question : how can i send email to some “group users” ?

    Thanks

  • Kate

    Hi there,
    I have been using the Groups plugin very successfully, really like it. I am also using WooCommerce for my shop. I know I can use the access restriction at a product level but I would really like to use this at the variation level.
    For example, I have a product that is available in one size for non registered users. The same product is available in different sizes and prices for registered users.
    So rather than create duplicate products to handle this, would it be possible to have the access restriction at the variation level?
    Thanks & best wishes.

    • Hi Kate,
      Although the idea seems quite simple, I don’t think this is something that would be added to the general solution, because it would add a lot of complexity that in most cases wouldn’t be used. May I ask what kind of product this is and why you restrict different sizes to registered users? In case a simpler idea might help …

      • Kate

        Hi Kento,
        I thought I’d subscribed to receive a notification of your reply but I think I must have missed it, only just checked back. Thanks very much for your reply.

        I’m working on a site that is open to the public and also has a registered members area. The Shop is available for both types of user.

        It’s for an aromatherpay company selling essential oil blends. For non members (i.e. the general public), the blends are available in 5ml size @ 11.99. For members, the same blends are available in 5ml size @ 7.99, but also in 25ml and 50ml sizes.

        I’m going with the option of having two product pages for each blend, one with the public price and one for members only with discounted price & bigger size options.

        I was hoping to be able to use the same category for both public and members blends, but that would mean members would see duplicates as I can’t see a way to not show the public content to members.

        So the only solution I can see is to use separate categories, which is not ideal as the public will see the members category and vice versa, however I can some information on becoming a member for the non members viewing the member category.

        I think that will work, unless you have a much simpler solution! :)

        Any help very gratefully received!
        Thanks,
        Kate.

  • Erwin

    Hi Kento,

    Thanks for an excellent plugin. I would like to report a minor bug and propose a fix; to add a column to the table on the users page in the admin interface, you return ” if the column name isn’t the one of the groups plugin in class-groups-admin-users.php:manage_users_custom_column. However, if there are other plugins, you’re effectively emptying their column. The signature of this method and its first line ‘should’ be:

    public static function manage_users_custom_column( $output, $column_name, $user_id ) {
    $output = $output ?: ”;
    ….

    Cheers,
    -Erwin

  • JD

    Hi, Kento.

    First of all, thanks for the great plugin. I have just one small feature request. Could you add a parameter to the [groups_join] shortcode, that could be set to display a message to logged-out and non-registered users? So we could do something like:

    [groups_join group="X" logged_out_message="Please register or log-in to join this group"]

    I tried just putting a message like that within a [groups_non_member group="registered"], but it doesn’t work, because this is already in another [groups_non_member] block.

    I guess another option to fix this problem would be to enable nested shortcode blocks.

    Thank you for listening.

    • JD

      I was able to get around this by using [groups_can_not capability="level_0"] to enclose the message. But I still think that there should be a message like that built in, to let people who aren’t registered or logged in know that they need to before they can join.

      Thanks again for a great plugin!

      • I just saw your follow-up on this :) I would rather not use level_0 (user levels were deprecated in WordPress 3.0) but try the approach I’ve suggested. In any case, I’ve taken note of your suggestion to add that parameter :)

    • Hi JD,

      That would be an option, although wouldn’t it be simpler to just do:

      [groups_non_member group="Ducks"]Please register or log-in to join the Ducks[/groups_non_member]
      [groups_join group="Ducks"]

      The shortcodes allow nesting by the way, you just can’t nest the [groups_non_member] shortcode within itself.

      Thanks for using Groups JD, suggestions like this are always welcome. Please let me know if the above is a viable approach to what you want to do.

  • Is there a way to change the error message displayed when a user doesn’t have access? Or does it just use the theme’s default 404 message? It would be really nice if it were a separate message and customizeable. If found this plugin: http://wordpress.org/extend/plugins/groups-404-redirect/ but I have a custom registration page. So I’d like to say something like “Sorry this page is only available to registered members. Please login or register.” Is that possible? If the page is actually 404, then I want the default to display. But if it’s just protected by Groups, I’d like to display a different message and some links like that. Thanks.

  • zack

    Just wanted to double check:
    Can a user could be added to multiple groups?

  • Romain

    Hi,
    I have two different forms on my site and i want 2 groups of users on my site, is there a way to automatically add users in the specific group after one of form suscribed.
    Regards

    Romain

  • I am currently putting together a Woocommerce powered site and need the ability to:

    1. Allow customers to purchase access to a single WP “Page”. (Product)
    2. Allow customers to subscribe and have access to many (or all) protected pages.

    There will be several single “Page” products (containing video tutorials), so creating a group for each product doesn’t seem right.

    Would this plug-in be able to handle this? Am I thinking about this incorrectly?

    Thank you!
    Frederick

    • In this case I would use one group per page and one group that grants access to all the pages (or more for subsets). Using own access restriction capabilities for each group you should be able to handle that nicely.

  • Hi.

    I’m hoping you can help.. What I’m trying to do is create a website for the different departments in my company.. Basically I am the administrator.. and I want the individual team leaders to be editors..

    I need the team leaders to be able to add users (I’ve allowed this using User role editor plugin) and then assign each user to an individual group.. so they can control the content that they want to show to each of their team members.. This seems to work if I (as the administrator) give set up the team members as users and as groups.. but when I try to do it as an editor I am able to tick the box for access restrictions that I want and when I try to publish the page/post it gets unticked again.

    I do not wish to give the team leaders access to all administrator privileges and had gone down the route and created another administrator and hidden the menu options I do not want to show bases on username.. but obviously this is not a good solution..

    Please help if you can..

    Thanks

    • ok.. I’m getting confused now.. It is working for editors on normal posts.. but when I try to update a custom post type and restrict access as an editor it doesn’t update on publishing..

    • Hi Paul,

      Testing this as an Editor (i.e. a user with the Editor role), when publishing a post with the groups_read_post access restriction checked, the post (or page) is published and the access restriction is checked. When the user does not have the groups_read_post capability, trying to view the post will get a ‘Not Found’ error. But I can’t confirm what you describe so this is probably a conflict. Please try to disable all other plugins and test again.

      • Hi Kento,

        Apologies for taking so long to get back to you . I”ve been off work for the last month and am only getting back to this project now..

        Right.. I’m not sure if I explained myself clearly at all..I’m talking about write access to the post. Basically what I have done is create a user for my team leaders.. I have assigned them an editor role.

        I have also (as an administrator) created groups, say for this example, TEAMA and TEAMB. I have assigned a capability to TEAMA called read_teama and a cabability to TEAMB called read_teamb. These capabilities appear in the Access restrictions box on the post

        I have created some users and assigned them the subscribers role. I have assigned half of these users into TEAMA and half into TEAMB.

        When I (the user with an administrator role) create a post, I am able to select the capability on the post and publish it.. And on testing the front end it is indeed available for the users in the Group with the correct capability. so I’m happy with that.

        What I want to do is allow the team leader who has the role of editor on the site to be able to publish the post and select what capability should be allowed to access it.. I follow the same procedure as above but after I select the capability and publish the post, the checkbox for the capability returns unchecked.

        I don’t want to give the tram leaders the role of administrator. So I’m just wondering if this functionality is available for users with a role of editor?

        I’ve set up a clean installation of wordpress 3.5.1 and am using twenty twelve theme with only the groups plugin installed and activated. So I think I can rule out a plugin conflict?

        Thanks for your help.

        Paul

  • Yip no matter what way I try I cannot get it to work as an editor on a custom post type? Should I give up or am I just doing something wrong.. I would be very happy if I was just doing something wrong..

  • Hi Kento – I have Groups, Groups for WooCommerce, Woo Subscriptions and the PayPayl Digital Download Extensions installed.

    I have a membership site. One month for $19.95 recurring.

    I have one Group which is Premium. Everything works great. Once an order is placed, under Users I see the following:
    Role=Subscriber
    Groups=Registered and Premium

    Once a member Cancels or Suspends an order (Which by the way, this idea to give the customer the ability to Suspend or Cancel on their own is asinine!), the User’s setting change to this:
    Role=Customer
    Groups=Registered and Premium

    So the only thing WooSubscriptions did was to change the Role from Subscriber to Customer. This change in no way prevents the member from still getting access to my content (Those pages that have a privilege set to Premium) because the Groups do not change.

    Do you have any suggestions on how I can prevent access to view those pages which have Premium privileges once the Role gets changed from Subscriber to Customer?

    I’d really appreciate your help.

    Thank you

    John

    • Hi John,
      When a subscription is cancelled, it doesn’t imply that the user must be removed from a group immediately. The user is removed when the period that has been paid for is over. For example, X orders a monthly subscription and gets access to a premium group while the subscription lasts. During the first month, X cancels the subscription (very rightfully they should be allowed to cancel their subscription by themselves, otherwise the seller could have the chance to ‘never let go’ of a client). X still has paid for the first month and should be granted access to the premium group during that month. As the subscription is cancelled, after the first month is over, the user will be removed from the premium group. Note that this is not the same as a refund, with a refund the user will be removed from the group immediately.
      Cheers

      • Hi Kento,

        Thank you. I want to apologize for using the word asinine in my previous question. After further reading, I now realize why the option to allow customers to suspend or cancel their subscription is there. However I still would prefer to choose whether or not a customer has that choice. I know realize that regardless if the customer is given these options from a sellers web site, the buyer can still go into their own PayPal account and cancel or suspend from there. Something no one ever talks about. I’ve been in contact with the dev of subscriptions for woo and it looks like giving the seller control over how many times the buyer can suspend or whether or not they can cancel at all my be forthcoming.

        After reading your reply, I see now that if I “Refund” an order, the customer is automatically removed from the Premium group. I was not aware that by canceling an order, the customer would automatically be removed after the trial period is over. That’s great.

        My only question then is the Suspend option. If a customer or I Suspend a subscription, it suspends the account from being billed. But that too should prevent them from accessing my content. The problem with allowing a customer to Suspend, is that they can Suspend the account then reactivate once the next billing date has past. In a sense, keeping the subscription perpetually going without having to pay. The customer could Suspend the account a day before his next billing date, then re-activate the account after that billing date has past.

        Since it’s so rare that a customer would want to suspend, I’d prefer to have the customer contact us, allow us to put the account On Hold or Suspend which will then prevent them from accessing the content until they are in active status again. However, I see how that can be a nightmare since the subscription extension would then have to keep track of exactly how many days he’s had access to our content. Right now it bills exactly every 30 days.

        My question is then this… is it possible to have an account that is put On Hold or Suspended to automatically be removed from the Premium Group? Or would you suggest that we manually remove the user from the group ourselves? A perfect example is that someone paid using a stolen PayPal account or credit card. In a case like this, PayPal suggests not to refund anything as a chargeback is automatically processed on PayPals end. If we refund the customer, we can loose out twice.

        One last thing I’d like to point out and that there is very little documentation on the Status Options in WooCommerce. Right now we have:

        Pending
        Failed
        On-Hold
        Processing
        Completed
        Refunded
        Cancelled

        What I’m starting to realize is that these options are more esthetics for the Seller than anything else. For example, Pending, Processing, Completed, Oh-Hold, Suspend do nothing to affect the permissions a user may have. Only Refunded and Cancelled. There is also no way to manage the emails that get sent depending on what the status is. I hope they address this in WooCommerce 2.0.

        Thanks again for replying to my questions.

        • Hi John,

          Thanks for your detailed explanation, I think the best solution would be to just add this functionality to the Groups WooCommerce plugin. WooCommerce Subscriptions already provides the necessary actions when a subscription is suspended and reactivated, so it’s just removing the user from the group and adding back again at the right time if these happen. I’ve added the feature request, depending on the complexity of its implementation, I hope it can be included with the next update of the Groups WooCommerce plugin.

          Cheers

  • Group plugin not compatible with ‘woothemes -> sensei plugin’ . When we activate those two plugins, we’got this fatal error: Call to undefined function wp_get_current_user() in /home/…/wp-includes/user.php on line 209, both on front and back end.

    I have to delete de ‘group’ plugin folder via FTP to be able to get wordpress work again.

    I’have tested it on a fresh install wordpress 3.5.1, without any other plugin installed.

    Thanks to fix that bog, I’m gonna post the same message on woothemes website.

  • On this page that we are on right now.
    http://www.itthinx.com/plugins/groups/
    In the section
    Content visibility for members and non-members
    [groups_member group=”Registered”]
    Has the wrong type of quotes.
    As well as other examples here.
    New user’s copy from these examples and they don’t work because the quotes are wrong.
    Can you update this page to have the correct quotes?
    Just trying to save others time tracking it down.
    It gave me fits…. :)

  • Try to install Groups for wordpress with Groups woo commerce and seinsei plugin
    But i have this bug !!!
    fatal error: Call to undefined function wp_get_current_user() in /home/…/wp-includes/user.php on line 209
    Can you please send me as soon as possible the solution

    Thank you

  • Luke

    Thanks for this great plugin. I have set up Groups in conjunction with WooCommerce in the hopes of selling a premium membership. More particularly this is being done on a single page basis, so I was hoping to there would be some way to reveal a link through to this page in the order email they receive.

    I guess this would be available one way or another through the customising the email templates. Do you know of any easy way to debug these? Some way to faux trigger this being sent?

  • I must say Kento, I am impressed and amazed reading your replies to all these comments. I don’t understand why the stats for the plugin show only 6 of 23 resolved. It looks to me you’ve given 100% response.

    When I installed Groups plugin via wordpress, it crashed both my website and wp-admin. No access: error – configured incorrectly. It has given me several different messages:

    The website encountered an error while retrieving http://www.cathlenebollin.com/wp-admin/plugins.php?activate=true&plugin_status=all&paged=1&s=. It may be down for maintenance or configured incorrectly.

    The website encountered an error while retrieving http://www.cathlenebollin.com/wp-admin/plugins.php?action=activate&plugin=groups%2Fgroups.php&_wpnonce=98179f7bc4. It may be down for maintenance or configured incorrectly.

    Here is what I did:
    Initial install of Groups plugin crashed website and wp-admin.
    Renamed Groups folder thru cPanel file manager.
    Website and wp-admin back.

    Install Groups plugin, install went fine this time, crash during activate.
    I renamed Groups folder, etc – same thing three tries.

    Idea from a post here: conflict with another plugin.
    I deactivated my only other active plugin Sensei.

    Groups plugin installed and Activated – all ok.

    Activated Sensei plugin and crash again during activate.
    Renamed Groups folder like before.
    Access to website and wp-admin ok again.

    Groups plugin installs and activates fine by itself.
    Sensei plugin installs and activates fine by itself.

    Website and wp-admin both crash, deny access, say configured incorrectly when I try to have both plugins active.

    The reason I got Groups is Sensei documentation said I need it so I can allow access to specific pages (coaching sessions and homework) via login by my clients.

    Groups, Sensei and WordPress documentation all talk about both plugins working together.

    Any idea what is causing it to crash on me?
    Thank you Kento.

    • Many thanks Cathlene, I suppose you’re referring to those on wordpress.org, these are not synced with the responses given here although I’m trying to attend to them regularly as well. Trying to keep up with all is daunting sometimes though, but I certainly appreciate all the feedback that is provided :)
      I’ve proposed a fix for the issue and hope that during the next days you will find it solved.

  • I found a question like mine. http://wordpress.org/support/topic/fatal-error-after-activating-1?replies=5

    QUESTION by Jabka
    When I activate the plugin I get this error message:
    Fatal error: Call to undefined function wp_get_current_user() in /var/www/web94/html/wplms/wp-includes/user.php on line 209
    I’m running the latest WP version and the only other plugins I have activated are woothemes-sensei, woothemes-updater and Akismet.
    Anyone knows what’s wrong here?
    http://wordpress.org/extend/plugins/groups/

    ANSWER by John
    Yes, Groups is conflicting with WooTheme Sensei. WooThemes is aware of the solution and said that they are working on a solution with the Groups author.

    I’ve got a ticket open with WooThemes support, trying to get an idea of what the time line on the fix will be. I’m dead in the water with the project until either Groups or Sensei is fixed and updated.

    • It seems the issue has been resolved with Sensei 1.0.4.

      • RESOLVED! Thank you Kento. The WooThemes Sensei update fixed it.

        I have both Sensei and Groups successfully installed and activated in WordPress.

        You are doing an amazing job keeping up with everything – WOW! You deserve a big HUG!

        • Thanks Cathlene but the guys at WooThemes were actually quicker, I just hadn’t noticed the new release was already available ;)

          • PaulMighty

            I am seeing a conflict between Sensei and Groups again. Running WP 3.8, Sensei 1.4.7 and Groups 1.4.6. I have “Front page” set to a default page in Reading Settings, which produces this warning on the Front page:

            Notice: Undefined property: WP_Query::$post in [website]/wp-includes/query.php on line 3296

            Notice: Trying to get property of non-object in [website]/wp-includes/query.php on line 3671

            Notice: Trying to get property of non-object in [website]/wp-includes/query.php on line 3673

            Notice: Trying to get property of non-object in [website]/wp-includes/query.php on line 3675

            -PaulMighty

            • Hi,

              I don’t see anything related to Groups in the notices. Besides the notices, is there any behavior on the page that is different from what would be expected?

          • PaulMighty

            Kento, I am not seeing anything else behaving strangely, just those notices. I’m running a clean install of the Bones starter theme with only Groups and Sensei activated. The notices only appear if both are activated, deactivating either one removes the notices. Not sure how to troubleshoot based on the output :/

            -PaulMighty

            • I would start with the usual, disable all plugins and use a ‘standard’ theme like Twenty *, then enable other plugins individually until these show up. That would help to identify what’s causing the notices.

  • Hello Kento,

    I am attempting to do something with your plugin that it’s designed intentionally not to do. Let me explain, and maybe you’ll be able to help a little :)

    I am using woo commerce, groups, groups for woo commerce, and subscriptions and am attempting to provide support for 3 months to every client that purchases a software product of mine.

    The catch is, that I am running the support site on a subdomain of the ecommerce domain. It is a multisite network, and I run woocommerce on the root domain. I have my support setup to be on support.rootdomain.com

    I am using “multisite User Management” in order to assign roles to customers for all of my subdomains, including the support subdomain. This works out perfectly.

    I have created a product, mandated that the customer register for the site in order to complete the purchase, and have assigned that customer a 3 month subscription to a group I’ve called support. This works perfectly.

    I have then setup the necessary capabilities for that group, on every domain, to be able to view the content on that domain if I want them to.

    I modified your plugin slightly. I didn’t actually add anything, I just strategically removed the parts of the plugin that assign the “registered” group to all users, renamed it “support” and then changed the code in the groups for woocommerce extension to enable “Support” group to be chosen as a group to assign via a product purchase.

    So, now everything works perfectly for me, except… After a user purchases a product, and is signed up to the group, if he tries to go to the support subdomain and view the restricted content, he is unable to do so. The groups are still independent on a site by site basis. You made it very clear in your code base that that was your intention.

    So since the groups are housed in different tables, and capabilities are housed in different tables, all on a site by site basis, even though I am registering the exact same group on every site, and the user is signed up to the same group name on the main site, he isn’t able to view the restricted content on the sub-sites.

    Do you think you might be able to help me achieve this? I have gotten pretty far with it, but beyond this, it’s a little out of my comprehension. I would be more than happy to submit a resolution to this problem to woocommerce as well, or you could even repackage it and sell it, whatever you would like. I just think the ability for a customer to move from site to site and still be able to see the content restricted by one group would be fantastic!

    Please let me know what you think, I have subscribed to your comments, so I will receive a notification when you reply. Hope you are well, and thankyou for such an awesome plugin.

    -Aaron

    • Hi Aaron,

      I had your comment marked for review and finally got to read through it ;)

      Regarding the cross-blog-access-restriction, I would suggest using the groups_user_can filter. Implement a filter where you could simply switch to the main blog, check if the user has the required capability or just belongs to the support group and switch back to the original blog to return the appropriate value. The filter is called in the Groups_User::can( $capability ) method (see class-groups-user.php) and takes three parameters. I would pack the code in a little plugin which you could install on the support blog (I don’t see the need to network-activate that).

      What I don’t understand is the modifications you have done, I assume you’re aware of the inconveniences of hacking the plugins themselves and that you really shouldn’t do it, that aside, if you just want the users to belong to the Support group, why don’t you simply create that group and assign it on the products that should grant access to it? If you’re using the Registered group, anyone would belong to that group anyway. Or am I missing something here?

      Cheers

  • janpolsen

    Is there a way to get an array of capabilities for a given user?

    I had hoped for something like:
    $user = new Groups_User( $current_user->ID );
    $caps = $user->capabilities;

    • Yes, that will result in an array of Groups_Capability.

      • Jan Olsen

        Does your email notification work? If it does then I must have missed your reply :(…

        Anyways…

        global $current_user;
        $user = new Groups_User($current_user->ID);
        $caps = $user->capabilities;
        var_dump($caps);

        … just results in NULL, while I would assume (according to your reply) that it should return an array with the capabilities assigned to the groups the current user is a member of.

        I am running the above script through the “Insert PHP”-plugin – could that be the problem?

        • Here’s an example of how to retrieve the capabilities for the groups the user belongs to:

          global $current_user;
          $user = new Groups_User( $current_user->ID );
          $groups = $user->groups;
          foreach( $groups as $group ) {
          $caps = $group->capabilities;
          echo var_export( $caps, true );
          }

          You can run that through Insert PHP, too.

  • perceval84

    Hi,
    I’m experiencing a problem with navigation links and posts per page.

    It seems the links “older entries” and “previous entries” are built before the filter on capabilities is executed, when the loop has already done its job.

    Also after the last release, for me the problem it’s still there.

    Whether I use a plugin for page numbers, or the standard wordpress pagination, the number of posts listed in pages still changes if I activate Groups.

    Maybe I’m wrong, but it seems Groups keeps filtering (and reducing) the post array only after the pagination is prepared…

    Thanks for the help…

  • I have installed a plugin called “Private Messages For WordPress” that allows “emails” to be sent to members on the site. However I need to be able to send them to a group or groups. Any ideas how this might be accomplished? Is there another plugin that might help create that function?

    Thanks

    • Just to be clear: they aren’t really emails, they are just private messages that appear in the “Inbox” of the other user created by the Private Messages plugin.

  • Dan

    Hi kento,
    Using Groups after it was recommended to me on Google+. Liking it but for one problem with a WooCommerce install that’s not playing nice – but I’m not sure if it’s by design.

    The objective is to hide the WooCommerce shop from public view, and make it available only to authorised (logged in) users (however this is not a subscription based membership.)

    I have everything setup as it needs to be – groups, capabilities, enforce read access, and having tested it, everything works – except for whichever page is designated in WooCommerce as the shop’s base page – that will appear regardless of access restrictions

    Can you help? Is there something in the setup I’ve missed? Is there an “override” in WooCommerce I can remove?

    Many thanks!

  • I’m building a site for a client and everything is working great on my dev server but after moving live I’m experiencing some weird 500 internal server errors so I contacted HostGator about some error logs and they came back telling me that the problem was with the Groups plugin and that when disabled the site would start responding again. The error that was logged is as follows:

    [Mon Feb 11 14:22:43 2013] [error] [client 74.202.255.243] Premature end of script headers: index.php, referer: http://vpmarketingondemand.com/wp-admin/post.php?post=910&action=edit

    Oddly it happens mostly on Safari/Chrome but I have reproduced it in FireFox also. It’s happening when we edit a page and then click on ‘View Page’ within the update notice after clicking save.

    Any ideas on how to fix this? I’m lost here ;/

  • jon

    Hi, is there any way of being able to have the user select a group from a drop down menu on the wordpress site? preferably at registration?
    Cheers

  • Victoria

    I am building a site for which I need to kinds of memberships: one is free (just sing up needed) and the other one is a paid suscription.
    the members of the free suscription can have access to restricted content in pages A, B C.
    the members of the paid one should have access to the restricted content (pages A, B C)+ a video page (its an elearning course that im selling.
    can i do that with your plugin?

    in addition to this i need to use MERCADO PAGO gateway. I purchased a plugin to use MERCADO PAGO with woo commerce and it works great, but i dont know if this plugin will work with yours. what do you think? i can send you this plugin in case you wanna see it.

    can you help me? my purchase relies on these two features.

    regards,

    victoria

    • Do you need it to be a subscription with recurring payments or is a limited (by time) membership an option? If you don’t need recurring payments, then any payment gateway is supported with Groups WooCommerce. If you do need recurring payments to maintain memberships, then it must be a gateway that is supported by WooCommerce’s Subscriptions plugin. In the latter case, I would recommend you to ask on WooThemes if that gateway is supported, if it’s not, at least there is some feedback that there is interest for it :)

      • Victoria

        thanks for your prompt reply. i just need one payment. the MERCADOPAGO gateway plugin for woocommerce is actually working with woocommerce, so it would work with your plugin then?

        what about the 2 kinds of memberships i told you about? can i have one free membership with access to some stuff and a paid one with full access?

        do you have a money back guarantee?

        regards.

        • Thanks Victoria, for the free membership it would be sufficient when a user signs up or a customer places an order. They would belong to the Registered group automatically and you can grant access to content based on capabilities assigned to that group.
          Basically any payment processor will work with normal non-subscription but either unrestricted or time-limited memberships based on Groups WooCommerce. If you want real subscriptions, it will need to be a payment processor that is supported by WooCommerce Subscriptions.
          As these extensions are sold through WooThemes, please refer to the current terms and conditions of sale there.

  • Jan

    Hi
    your groups plugin I have because of Woocomerce and their subscriptions (and your simple but logical ability to have one subscriber subscribe to more than one group – yipppeee, THANK YOU)
    I just want to vote for mass emailing a specific group when I release a new lot of posts – it is a ‘little’ thing of no real issue to many, but I would love it to email subscribers about new magazine issue
    Thanks so much for the grand work you

    • Hi Jan,

      Many thanks for your voice on the group-email feature, I’m sure it would be a welcome addition to Groups. It would be quite simple to create a basic plugin that lets you email a specific group, although a good solution would allow group members to subscribe (or not) to those emails. Users should be able to decide whether they want to receive those emails, otherwise those who don’t want to receive them would just consider them spam. There should probably also be a way of archiving the emails that have been sent, a choice on message format (plain or HTML), maybe templates … thinking about it, this would be eventually be a newsletter system based on Groups ;) Or an integration with an existing solid newsletter plugin.

      I’d love to hear opinions on that and if you or someone else wants to suggest an integration with an existing plugin, it’s of course welcome.

  • Victoria

    kento,
    1.how can i set up a registration page with fields such as name, email, city, etc?
    2. how can i assign users to the different groups? they are already created.

    regards

  • Nico

    Hello,

    Thanks for this plugin, it’s awesome!

    How to programmatically add a user to a group?

  • Matthew

    Great work! How would go about translating the plugin into french?

  • Hi Kento,
    Can you tell me the best way to import a list of WP users from a CSV file,and also place them into one or more groups ?
    Thanks,
    IS

    • Hi Isaac,
      Do you need to apply criteria to assign those users to one or more groups? Assuming you do an import, all users will be added as members of the Registered group when their user accounts are created, would that be sufficient?

      • Hi Kento,

        No. That wouldn’t be sufficient.

        Yes. I’d like to include them in one or more groups, and have it import them as “Users” that are already assigned to the correct group(s).

        • Then the best way I can imagine is to use an existing CSV import plugin and derive something from it, if you have the group membership information along with each entry, it should be fairly easy to do.

  • Tobias Fransson

    Hi Kento,

    I am using Groups with Woocommerce Groups and I am trying to use groups to work with Simple Press in order to sell a product (a group level) and automatically give access to the respective “product forum” in simple press.

    Although Simple Press integrates with WP User roles this isn’t ideal for me as I will be doing a lot of products and I would need to create 1 WP role per every possible combination of products making things un-manageable.

    Someone on the simple press forum suggested that when a customer buys my product a custom user meta field could be added and that would work with simple press.

    I’m not a programmer and the conversation over at simple press support forum is now way over my skillset.

    I would like to be able to get groups to work with simple press in a way that doesn’t involve using WP user roles so that I can stack the access levels.

    Ex. setup product 1 by using groups and in Simple Press setting it up to match a forum. When the user then buys product two he gets that extra access level added to him rather then moving from one wp user role to another.

    Is this something that groups support or does this need to be developed?

    The obvious benefit here is that simple press is widely used and the only “real” WordPress native forum alternative to bbPress etc. and I really think getting groups to intregrate with simple press will be highly useful and appreciated in the wordpress community.

    • It seems you haven’t noticed Groups Forums yet :)

      It leverages the facilities provided by WordPress and is light-weight. In fact, I’m preparing a post with a performance comparison between Groups Forums and bbPress … so much I can already tell, there’s a considerable difference in performance (in favor of Groups Forums).

      • Tobias Fransson

        I am looking for something more advanced then Groups Forum, bbPress is also more of a bulletin board then a forum and not what I am looking for.

        Group Forums has potential but needs to be developed way more for my purposes vs simple press that has 90% of what I am looking for but I am not sure how to get simple press to recognise groups access control.

        What would it take to get Groups to integrate with Simple press without using WP roles?

        • It surely depends on what you’re looking for, whatever seems to match what you need more, should of course be a closer choice.

          After doing the tests yesterday with Simple:Press, which to me looks like a completely independent system that does not intend to leverage WordPress’ features, I would say it would be rather difficult to integrate it with Groups.

          Taking into account that it also has a huge performance impact, I simply don’t think it would be worth the effort of trying to make it work with Groups. Simple:Press creates 19 new tables in the database and even uses its own table for forum posts instead of taking advantage of WordPress’ facilities for that. Groups is integrated with WordPress’ facilities, making it work with a system like Simple:Press that is basically mounted on top of WordPress and does its own thing, just doesn’t look like a good idea to me … please note that I’m trying to answer your question about roles based on problems I suspect and without entering into technical detail ;)

  • Takis

    Hi,

    has anyone been using Affiliates Pro on a Multilingual environment?

    I am using WPML on my site and just about to try it.

    Are there any known issues or anything else that I should know?

    Many thanks in advance.

  • Awesome plugin – so glad I finally purchased it!! I do have a couple questions…

    1) I can get the plugin to work fine using the in-page shortcodes to show/hide content to the correct group (members, non-members). However, as soon as I use the <!–nextpage–> shortcode, the whole thing stops working and the page is no longer protected. Aside from actually breaking the page up into multiple pages, is there any way to fix this?

    I sell tutorials, and one of my tutorial pages is over 5,000 words and 19 sections long so far – I really don’t want to break this up into different pages.

    Using shortcodes, it was my hope I could have a non-member section that showed the item they need to purchase to view the page – this would be essentially like a targeted 404… Since the <!–nextpage–> shortcode is breaking my page, I resorted to the 404 page.

    2) I’ve see a ton of people comment on the 404 issue. I do have the Groups 404 Redirect plugin installed and have it pointed to a specific post. However, (like several others have mentioned previously) I’d love the ability to specify a particular destination page, depending on which group the user tried to access. I’m selling tutorials, and if a customer clicked on “Tutorial C”, I’d like to take the customer to a product page selling “Tutorial C”, not a generic shop page that shows anything and everything else available on my website.

    • antonio

      Hi Eric,

      If you use <!–nextpage–>, you must restrict access with capabilities. With shortcodes you can’t do it.
      By example:
      capability: Premium
      Group: Premium
      in Groups->options: check Premium to show in posts
      And in the post, check restriction Premium.

      With Groups 404 Redirect you only can redirect to a page independently from the group.

      cheers

  • Joey

    Great plugin. Thanks!

    Is there a way to set the default groups for all new posts?

    I allow certain clients to create posts. I don’t want the clients to see all of the access restrictions options when adding a post. Instead, I’d like the restrictions to be automatically set for all new posts. I can then hide the meta box in the Add New Post screen.

    Thanks.

    • antonio

      Hi Joey,

      you can setup in Groups->Options the Capabilities that you want show in posts.
      And show only the desired Capability.

      cheers

      • jaybe

        I believe something different is being asked.

        Restated: Is there to set /default/ Group(s) read/access restriction, automatically, for new posts/pages?

        e.g. Upon creation of any/every new post/page, the post/page is /automatically/ set as read restricted to Groups: A, B, and D, … without user/author intervention.

        *The point here is to /ensure/ newly-created content by non-savvy authors/publishers aren’t published as “public”, and are instead published and restricted by the proposed defined Groups’ defaults.

        • antonio

          Sorry,
          You can’t set default restrictions automatically for new posts/pages. You can do it using “Access restrictions” checkbox and/or shortcodes.

          cheers

  • Hey there,
    I would like to create widgets in the dashboard, or on the front end, for logged-in users to see what content they have access to. I don’t see an apparent way to do this. I’m using Groups + Jigoshop. So I’m curious what the best way to achieve this is.

    • Hi Alex,
      If you’re using for example a list of links to posts as in an archive template, it would automatically show the ones the user has access to. Have you tried that?

      • Hey Kento,
        No, I haven’t tried that, but it sounds intriguing. If I were to use an archive template, though, it would show all posts, not just what they have access to. Right? Essentially, if I were to go that route, I’d only want the posts shown that they have a group membership assignment to access.

        • If you use WordPress functions to query the posts, then they will be filtered through the functions defined in Groups_Post_Access. You would get an unfiltered list if you were to bypass these, for example by querying the database directly.

          • Hey Kento,
            Thanks again for the reply. Is there any sort of documentation as to the functions and parameters i can use via your groups plugin? This seems like it would be straight forward, but is a little beyond my understanding. having reference material would be a big help. =)

  • I’m having a pagination problem, which may be related to what other above have mentioned (whether they realized it or not).

    The number of post returned per page seems to be based on total number of posts, not the total number a user can see, throwing off the pagination. If “Settings > Reading > Blog pages show at most” is set to 10 posts, and the first ten posts returned by the query are not viewable by the user, then a blank page will be displayed. If posts 11-13 are viewable, however, http://mysite.com/page/2/ will show them. Likewise, if pagination is set at 10 posts, and 3 posts are not viewable to the user (restricted by Groups), that user will only see 7 posts for that page (rather than the first 10 viewable posts).

    Any ideas for a fix?

  • mitchell360

    Karim (@kento),

    Looking to be pointed in the correct direction to contribute.

    I am thinking about contributing to the plugin so that permissions are set at three levels:
    - see post/page in list
    - see excerpt
    - see the_content

    This way, we can do things such as: if you can see in a list, but cannot see excerpt or the_content, add a class with a lock icon.

    This is also important for our use of Groups as we have some custom post types which are essentially protected downloads. Right now, groups filters the post out of existence. We just want to filter the download action based on group/caps/roles.

    Can you help architect/design the approach? I want to make sure that we do it in line with your existing architecture vs. hack it.

    My current thinking is to:
    1. modify class-groups-post-access.php
    2. change user_can_read_post to user_can_see_post (since all of the current logic makes the post non-existent)
    3. create user_can_read_excerpt and apply filter appropriately
    4. create user_can_read_the_content and apply filter appropriately
    5. modify the code that provides metaboxes on posts/pages for these three “levels”

    Am I missing anything significant?

    • Thanks for the suggestions, I know that some of what you mention would certainly be welcome – I’ve been asked if features like that would be possible within or as an addition to Groups.

      Before being able to recommend on or evaluate it, I need to have a thorough look at what you’re suggesting and the impact as well as requirements that would have within Groups.

      If you are already working on modifications, can you please co the current trunk from the wordpress.org Subversion repository so patches can be generated? It’ll be easier to review the modifications for me that way (I haven’t had time to create a repository on GitHub for Groups yet, but we can equally coordinate on good ‘old’ Subversion).

    • I really miss the opportunity to tease posts as well. Showing the title, the excerpt, the thumbnail. And when I click this from an archive listing, I would be prompted to log in, or buy a membership.

  • jaybe

    I noticed an issue whereby contextual content is provided and leaked in page source despite target content being assigned to a private Group.

    Specifically, for example, on a page set as the “Home” page, the following is in the page source, revealing the previous post link URL and Title:

    The “Friends Only Post” is set as read only to the “Friends” Group, yet that is included in the page source of the following post/ID.

    I presume this is likely a “WordPress” issue, however, protected content and information is being leaked. I wanted to share this to make you aware and hopefully find a way to protect and work around it.

    Please let me know if you need more information.

    • jaybe

      Again, clarifying:

      [link rel='prev' title='Friends Only Post' href='https://domsin.net/friends-only-post/' /]

    • It’s not necessarily a leak in every use case. In one scenario you might want to show it, in another you don’t. This would also depend on whether the theme is actively hiding links to protected posts or not.

      If you wanted to be sure that all links to protected posts are hidden, you would use the API that Groups provides, for example as mentioned here.

  • jaybe

    Is it possible to cause the current page to refresh, and or redirect to a particular page, upon a user joining/leaving a group via Groups’ join_group short code, for example?

    Scenario: user is on a “Subscription” page that provides ability to join/leave Groups. Also on that page are a list of post protected/visible/invisible by various Group memberships. Upon joining/leaving, I’d like the page/posts/visibilities to refresh, along with the current status of the Groups join/leave button/text, so the user gets an updated/current view after the subscription modification.

    Thanks!

    • antonio

      Hi,
      shortcodes not accept redirects, you can redirect using javascript. Here an example: http://pagebin.com/aM4bv9GI
      Be careful with the order of shortcodes.

      cheers

      • jaybe

        Thanks for reply. Would you expound a bit about being careful with the order of short codes? Why? What are the implications and how does that work? Also – I noticed inconsistency in the behavior of Groups. For example, after clicking “leave group”, immediately following, the “join group” button appears and is available. However, after clicking “join group”, the “leave group” button is NOT presented; that’s inconsistent. Is this an ordering issue? I feel like I would need more control of actions after join/leave in order to take advantage of such powerful functionality.

        • What he refers to is due to the shortcodes that handle adding and removing the user from the group, are acting at the very same place they are placed at. If you have a protected block before a button that allows the user to leave and another protected block after that, when the user presses the button, the content of the first block will still be shown, while the block after the button will not reveal its content. That is because when the first block is rendered, the user still belongs to the group, while in the second block the user has been removed from the group. That’s not an inconsistency but simply following the logic in a sequential execution of shortcode blocks.
          The same reasoning applies to the buttons, them showing or not just is strictly following whether the user belongs to a group when the button is rendered or not.

          • jaybe

            Makes sense; thanks for the clarification. As a result, it sounds like I need to perhaps not be leveraging short codes, and instead directly dealing with Groups at the API/PHP level in templates, plugins, etc.? I presume that might give me more control and perhaps stability over time versus using short codes in posts and pages. Are there examples of how to leverage the API to perform common functions such as adding/removing users to/from Groups, then refreshing and or redirecting? … common flows, etc.?

            Really appreciate and am excited about the work you’re doing and the possibilities of Groups.

            • Using the API is more flexible of course, it really depends on how fine-tuned you want to have your user experience. The API documentation is lacking examples on how basic use cases are implemented (I know that should be remedied at some point, but I haven’t had a chance to take care of that myself up to now), although a look at the code itself reveals well documented methods that can be used. There are also several examples here in the comments (hint: search for :: ).

              By the way, I can’t express enough how welcome I find comments like yours. I very much appreciate the interest people take in using Groups and other plugins that I maintain in order to apply them to fit their scenarios :)

          • jaybe

            Understood; thanks.

            How would I go about creating an interface whereby when the user joins or leaves a group, the page is refreshed, as well as the button/join/leave status?

            Example: I want to use Groups along with the join/leave buttons to provide an interface whereby users can enable/disable visibility of posts based on Groups as “categories” for content in relative near-time.

            When the user clicks to join the “See Posts: A” Group… the page is refreshed, including posts visible to “See Posts: A” Group, while also updating the button so they could easily leave/hide the group/posts in one click.

            Make sense? Thoughts? Neat stuff!

  • jaybe

    Using the API/PHP, how could one obtain a list of all the Groups available?
    Figured out how to list a user’s Groups… but I’d like to obtain a list of all available and or a subset thereof.
    Thanks

  • Marc

    Are you aware of problems with W3 Total Cache ?

    After I installed it, users were not longer automatically added to the group ‘registered’. Adding them manually worked.

    Had to disable Total Cache to let it work again.

  • jaybe

    Using the API/PHP, how could one obtain a list of all the Groups available? (not via shortcode… as the shortcode return is styled and filthy for processing). Thanks

    • Have a look at how the [groups_groups] shortcode is implemented in groups/lib/views/class-groups-shortcodes.php – you will also see that there are options you can use for what markup is generated without having to reimplement the thing yourself.

  • I have a question about the duration of the group. I have tried setting up the product in woocommerce the way it’s described in the video however I have no option to determine the duration of the group.

  • Marc

    No, the only thing I changed was installing Total Cache

  • Virgo

    Hi Kento,

    Is there a way to get the current group of a logged-in user inside the code of another plugin, or somewhere in the theme?
    thank you very much.

    • antonio

      Hi Virgo,
      you can use:

      require_once(ABSPATH . "wp-includes/pluggable.php");

      $user = new Groups_User(get_current_user_id());
      $groups = $user->__get("groups");

      More info here: Groups-API

      cheers

  • Dmitry

    Hello.
    When I activate the Groups plugin I get this error message:
    Fatal error: Call to undefined function wp_get_current_user() in /var/www/username/www/friends10.ru/wp-includes/user.php on line 209.
    On site installed Traction theme. I’m using latest WordPress version.
    Can you help me, please.

  • Fred

    Hello,

    Do you have plugin Groups in french?

    Best regards

  • Robert

    I installed the Groups plugin, deactivated, and then re-activated. When I reactivated the control panel under settings had disappeared. To fix it I deleted the entire plugin and reuploaded. After I activated it I noticed that the Settings>Groups control panel was still missing, although the older options in the individual posts were still visible.

    Why can’t I see the control panel for Groups?

    • antonio

      Hi,
      This behavior is not the usual. When you reinstall Groups you must have a new menu Item called “Groups”, and not a subitem in menu Settings.
      Please download the lastest version, and try it.

      cheers

      • I tried and it didn’t work. I also tried uninstalling, deleting cache, and then reinstalling. It didn’t work.

        • antonio

          Hi,
          you can test groups with other plugins disabled.
          if it doesn’t work, if you grant me edit access to the page it’s on I could have a quick look.

          cheers

  • James

    If i want to display a message on the page that is restricted to users who are not in the group that has access to a particular page instead of showing a 404 error how do I do that?

    even the 404 extension doesn’t make much sense, in each page that is restricted to a certain group i need to display a different message.

    Is there a way to do that?

    Thanks

    • antonio

      Hi James,
      you can do it with Groups 404 Redirect (http://www.itthinx.com/plugins/groups-404-redirect/)

      cheers

      • James

        Hi Antonio,

        Thanks. but i still can’t see how it can redirect each separate restricted page to a different page. I have installed it and as far as I can tell it is one global setting of all restricted pages redirect to one single page.

        What restricted pages should do is display a message instead of a 404 redirect or this redirect from the 404. each restricted page should have a message of it’s own. don’t you think?

  • Hi Kento,

    Thank you for all of your hardwork on this plugin. I am using it and planning on integrating with your Woocommerce groups plugin. I found one thing that I thought I would mention. Using the shortcodes, I have a page created that shows a message to non group members letting them know they do not have access, then I have another short code for group members displaying the content. This works great – unless the user is in two groups. Then it will show both blocks of content. Is there a way to prevent this?

    Also, this is great for hiding the content of the page, but is there a way to also hide the comments – so protecting an entire page of content including comments from anyone not in the group?

    Thanks!
    Amanda

    • antonio

      Hi,
      you can protect an entire page using capabilities (create a capability by group, and check this in post/page).
      Please share us the shortcodes you use for show blocks of content.

      cheers

  • Moonworks

    I’m having a bit of trouble.

    I’m using the WooCommerce groups exension, but I don’t see how I can manually add a member to a group. I’ve taken a look in the users admin, but don’t see anywhere in there that allws me to do it.

    Thanks

    • antonio

      Hi,
      you can see it in “Users” admin page, above the users table, you have ” Add/Remove selected to / from group:____”

      cheers

  • Moonworks

    I’ve used the following shortcode:

    [groups_non_member]

    But I’m still able to see it on an account that has membership of a group. Is there a way to fix that?

    Also, is it possible to place a shortcode within a shortcode? So if I only want somebody who is a member of two groups to see something, it will work? for example:

    [groups_member group="Whisper - By Michael Bray"]
    Thank you for signing up for a date on the virtual book tour of Whisper by Michael Bray.

    Please find the available downloads below:
    Guest Blog
    Interview
    Book Excerpt
    [groups_member group="Reviewers"]
    Review Copy
    [/groups_member]
    [/groups_member]

    • antonio

      Hi,
      [groups_non_member] works similar to [groups_member], you need set a group.For example:
      [groups_non_member group="groupA"]bla bla bla [/groups_non_member]

      It is not possible to place a shortcode whithin a shortcode. You can create a “super-group”(groupC) that represent groupA + groupB, and then use [groups_member].

      If you need show anything to a groupA OR groupB OR groupC… you can use ‘,’, for example:
      [groups_member group="groupA,groupB,groupC]bla bla bla[/groups_member]

      cheers

  • Suggestion for enhancement: it would be great to be able to assign posts to groups in bulk on the edit.php page. Has this ever come up before?..

  • Norbert

    Hello,
    I have istalled your plugin and I can use it on regular pages and post. But it doesn’t works with “WP Download Manager” “Package” called post type. It is enabled for this post type as you seen in attached picture ( http://screencast.com/t/QzL7izdCt ) but I see the short code in frontend. ( http://screencast.com/t/e7f1YHspOd7P ) If I put the same snipet to a regular page it works fine. How can I enable your plugin in this post type? This is the plugin: http://www.wpdownloadmanager.com/
    Thanks for help!

    • antonio

      Hi,
      I have tested Groups together WP-DownloadManager, and this works fine, an example:
      [groups_member group="Premium"]
      [download id="2"]
      [/groups_member]

      Careful editing text mode.
      Maybe your error is a conflict with other plugin.

      cheers

  • This plugins disable new post creation, installing new plugins and few more things when deactivated.
    When activated, these option work again but it looks like once you install it, there is now way to uninstall this plugin without breaking your site.

    • antonio

      Hi,
      this behavior is unusual, if you want, send us data access to support at itthinx dot com, so we can have a look.

      cheers

      • Hi Antonio,

        I sent details to support at itthinx dot com 2-days back. Can you confirm if you manage to debug it?

        • We’ve had a look, it’s an odd thing what happens there but, I think something has messed up your capabilities and when Groups is active it helps to regain some control. What I would suggest in this case is to first disable all plugins (some plugins even must be deleted, e.g. some caching plugins, to completely remove their effects) then check if everything looks as normal. If it doesn’t, you’re site’s messed up to say it bluntly … if it looks ok, start enabling plugins individually until you find which one actually interferes with for example the Posts section.

  • It appears search results are viewable regardless of permissions. Clicking on the post will return a 404, but post content is still entirely visible on the search results page.

    Is there a way to give search results the same behaviour (post not displayed if protected) as everywhere else?

    • antonio

      Hi,
      We are fixing this error, in the next version you’ll have available.
      cheers

    • There was never anything that needed to be ‘fixed’ in this respect (@antonio why do you think this has been fixed in 1.3.11? – I might be wrong but I can’t see where any of the changes that I made would have had any impact on that).

      If you get search results that include protected posts, then you have ‘something’ that includes those posts by itself. For example, a direct query to the database. Another reason could be a plugin that is interfering or a function in the theme.

      Things you can do (on a test site which should be a copy of your production site):
      - check how search results are obtained (check the actual algorithm)
      - disable all plugins except Groups and check the results, enable other plugins individually in addition and see if the results are different
      - use a default theme and see if that makes a difference

      I’d be interested to see what is causing this on your site, please let me know your findings.

  • ekg

    Bulk deleting of default capabilities would be SOOOOOO nice. I don’t want all of these unneeded capabilities cluttering up the screen, and now I have to manually delete every single one!!

  • diego

    I’m using you groups plugin in my blog since I need to have different groups of users. Each group of users should see only one category. Everything works wonderful. Every group has his own capacity, etc.

    The only problem I have is that in the wp categories widget, all the categories are shown to all users. IIRC, there is no way to fix this, even if I modify directly the categories widget?

    Thanks in advance!

  • alex wolk

    Is there a wordpress newsletter or email plugin that works with groups? I would love to be able to send simple newsletters/announcements to different groups through the backend. Do you have any recommendations or other solutions that might work? I would even be willing to pay for some development

    • Hi Alex,

      That’s something I’d be interested in, too, but I’m not aware of an existing integration with a newsletter plugin. I’ve considered creating a solution based on Groups myself, as several have already expressed interest in ‘something’ like that … it could be an integration with an existing newsletter system that works well, or something built from scratch. We can talk and see what might be interesting :)

  • Jan

    Hi,

    I would like to buy the plugin for jigoshop.

    Before that I need to know, is there a shortcode for login information.

    When the user login, could I redirect him to a certain page, not the user dashboard in WordPress?

    Thank you for your help.

    Jan

    • antonio

      Hi,
      Groups doesn’t change the behavior of login redirection.
      For this, you need other plugin, you can see Useful Plugins
      cheers

      • Jan

        Hey Antonio,

        I have installed the plugin Peter’s login redirect.

        However, I do not know how to set i up. Because I need the user of one group redirected to one page and the users of other group to different page.

        Do you have any guideline how to do it.

        • antonio

          Hi,
          I think you don’t do it with Peter’s plugin.
          Maybe, you can redirect to a comun page, and in this page, show a link according to that group belong.
          Code for that page, for example:

          [groups_member group="A"] linkA [/groups_member]
          [groups_member group="B"] linkB [/groups_member]
          [groups_member group="C"] linkC [/groups_member]

          cheers

          • Jan

            I see. Then maybe I am missing how to use the groups plugin.

            SO the purpose is to show only some content. To people who are loged in and are members of a group.

            Maybe it would would be worthy to create a plugin that would redirect members of a group to a page which is dedicated only to them.

            The plugin would gain extreme power.

            Please, do not consider my comment as a critique.

            • antonio

              Hi,
              with groups you can show some content only to the people who are loged in and are members of a group.But you can redirect at login to different pages.

              Don’t worry, all feedback are wellcome, and that you propose is very interesting.

              cheers

  • Groups plug-in 1.3.8. installed on a WP 3.5.1. installation.

    Groups gives me the option to display some columns in the Admin> Users > All Users screen. I can activate this option using the ‘Screen Options’ tab at the top of that page. However, when I look at that pull-down menu, I have the ‘Groups’ tick-box showing up twice. Even if I check both boxes I only get one bunch of group fields showing up on my All Users page. This doesn’t matter too much from an operational POV – but obviously something is not right and I’d like to fix it if possible. Any ideas welcome. TIA

    • antonio

      Hi,
      I have tested this version, and only appears once.
      Maybe there is a conflict with other plugin that generates this error.
      You can test desabling other plugins and/or reinstalling groups.
      cheers

  • karen

    I’m trying to use Groups plugin in conjunction with WooCommerce. I have talked to the commerce people and they do not think what I would like to do is possible, and told me to post in the groups forum.

    We are not using this as a traditional shopping cart.

    so for example:

    -You have a company.
    -In this company there are 3 departments.
    -Each department has a department manager.
    -In each department there are many users(customers?).
    -The users should be able to sign in and only see the products for their department, and order/pay for these items.
    -The department manager should be able to login, and see and approve any and all orders placed by his department, but NOT see any orders placed from another department.

    Right now I am having a problem trying to get the last point to work.
    I have already set up users, and roles, and have different products showing up for the different departments.
    HOWEVER when you login to the back end you see ALL the orders placed by every department. I would like the department manager to only see the orders placed by HIS department.
    Is this possible?

  • mohamed amine

    hi,

    can i have a sgin up with this plugin for registration?

    there is a shortcode for that.

    thx

  • thank you for your quick response

    I tried to do it but nothing happens in my page below the form.

    http://www.albarakagroup.ca/devis/

    • What’s supposed to happen when you submit the form? If you just place the shortcode below the form and the user isn’t logged in, it won’t show anything because the users have to be registered before you can let them join a group.

  • this is a great plugin. however I need to be able to have some ability to manually add users to specific groups, independent of their having paid for a subscription. Free subscriptino basically. I need to be able to do this because I’m moving one site to another. I tried to do this in the WP users menu, but there doesn’t seem to be a way to modify that

    help

    • antonio

      Hi Mike,
      you can do it, checking the desired users, and Add/Remove to group using the buttons just above the users table.
      cheers

  • T.J.

    How can I restrict a whole page for only guests?

  • Hi,

    Is there a way to get posts to be configurable for different user groups? Say, free, standard and premium, and have only some posts visible for a specific group? I can only find “groups_read_post”, so not sure if there is another way?

    Thanks!

    • Hi Henk, there’s an example on the FAQ page. It’s very flexible: you can freely enable any number of existing or new capabilities to restrict access. Assign these capabilities to the groups that should be allowed to view the posts, this means that you can have groups that can access independent as well as related subsets of posts …

      • Wow. Sorry for the noob question. I don’t know why I didn’t think of checking for a FAQ. Must be a combination of lazyness and a brain fart.

        I’ll check it out, thanks!

  • Melissa

    I installed the Groups plug-in, added 2 new groups, but I can’t see where to add my test user to a group! Please help!

    • In the User section you should see the selection box on top. If not, there might be a conflict with another plugin. With 1.3.11 just released, you can also enable editing group memberships on a user’s profile under Groups > Options > User profile.

  • Melissa

    I have 2 groups: Supporter and Member. Supporter will see some page content, members will see the supporter content PLUS their own additional content. I setup the groups and capabilities as laid out in the FAQ “Advanced/Premium” question. I am able to get this to work correctly if setting Access Restrictions on a post itself, but not seeing how to do this with shortcodes. I currently have two shortcode blocks, one for group=”Member” and one group=”Supporter”. When I login as a member, in only see the member content, not the supporter content as well. Please advise!

    • antonio

      Hi,
      you can use group=”GroupA,GroupB”, in your case:

      [groups_member group="Member"]
      This content is only available for Members.
      [/groups_member]

      [groups_member group="Member,Supporter"]
      This content is available is you are a Member OR a Supporter.
      [/groups_member]

      cheers

      • Melissa

        Thanks! Is there a way to rid of the white space that shows up on the page when these are in place.
        If I have the example above in place and a regular user sees the page (not able to see any of the supporter or member content), it shows two blank lines.

        • antonio

          Hi,
          newlines before, after and between shortcodes are showed.
          In this case, if you have:

          Text before.
          [groups_member group="Member"]
          This content is only available for Members.
          [/groups_member]
          Text after.

          Shows two blank lines.
          But if you use:

          Text before.[groups_member group="Member"]
          This content is only available for Members.
          [/groups_member]Text after.

          You have not blank lines.
          cheers

  • mitesh

    Is there any way I can add a user to a group in php .i.e. wordpress backend ?

    And is there any way I can move a member from one group to another group, again in php manually ?

  • Tobias

    Hi, I would like to show a message using groups shortcodes to members who does not currently have a specific groups “group” membership.

    Ex. a [Not Group=X] message text [/Not Group] style shortcode.

    Is this possibly and if so, what is the proper syntax/usage?

  • Richard

    Hi,
    Is there a way to display the different groups you have set up in the edit page/post page. So that I can restrict the page/post to a specific group rather than one with a capability? If I have several clients currently I would have to set up a group for each client, and a capability for that client. So that I can restrict a post/page to a specific client.

    thanks

  • Eric

    Found myself needing to systematically create new capabilities, groups and relationships for a custom post type using the API. The API documentation was very helpful, but also thought some examples would be helpful for others that are looking to do some similar things. Here’s some code snippets that could come in handy. No guarantees that these are the most efficient calls to make, but they’re working for me.


    $capname = 'new_capability';
    $groupname = 'New Group';
    // Create a new capability labeled $capname. Give it the description of $groupname for easy reference.
    Groups_Capability::create( array( 'capability' => $capname, 'description' => $groupname ) );

    // Create a group with the name of $groupname.
    Groups_Group::create( array( 'name' => $groupname) );

    // Get the group object using $groupname (so you can get the group ID later)
    $group = Groups_Group::read_by_name( $groupname );

    // Get the capability object using $capname (so you can get capability ID later)
    $capability = Groups_Capability::read_by_capability( $capname );

    // Create a relationship between the $capname capability to the group $groupname using the objects you got earlier.
    Groups_Group_Capability::create( array( 'group_id' => $group->group_id, 'capability_id' => $capability->capability_id ) );

    // Get the group object called "Membership"
    $membergroup = Groups_Group::read_by_name( 'Membership' );

    $ispartmember = 1;
    // Do you also want to make this capability part of the "Membership" group?
    if( $ispartmember ) {
    // Tie the $capname capability created earlier to the 'Membership' group you just retrieved.
    Groups_Group_Capability::create( array( 'group_id' => $membergroup->group_id, 'capability_id' => $capability->capability_id ) );
    }

    // Grant access to this post ($post_id) to the $capname capability.
    update_post_meta( $post_id, "groups-groups_read_post", $capname, $capname );

    // Delte the $capname capability (using the object you got above)
    Groups_Capability::delete( $capability->capability_id );

    // Delete the $groupname group (using the object you got above)
    Groups_Group::delete( $group->group_id );

    // Relabel an existing capability to $newcapname
    $currentcapname = 'current_capability';
    $newcapname = 'renamed_capability';
    $capability = Groups_Capability::read_by_capability( $currentcapname );
    Groups_Capability::update( array( 'capability_id' => $capability->capability_id, 'capability' => $newcapname, 'description' => $capability->description ) );

    // You just changed the capability label. Now update this post so it still grants access to that capability.
    update_post_meta($post_id, 'groups-groups_read_post', $newcapname, $currentcapname);

    // Rename an existing group to $newgroupname and keep the existing Parent relationship
    $currentgroupname = 'current_group';
    $newgroupname = 'new_group';
    $group = Groups_Group::read_by_name( $currentgroupname );
    Groups_Group::update( array( 'group_id' => $group->group_id, 'name' => $newgroupname, 'parent_id' => $group->parent_id ) );

  • Francois Wessels

    Hi there,

    Can Groups allow only a specific user to edit a custom post type — for instance listings for property where I would like to enable the agent to edit his/her own listing but not other agents listings.

    Kind regards

    Francois Wessels

    • antonio

      Hi,
      you only need create a capability for every user, and assign this capability to the post.
      For example:
      create capability: “canUserA”
      Assign “canUserA” to user “A”
      In Groups->Options: select this capability to be offered to restrict access to posts.
      In “postA” assign Access Restriction “canUserA”
      cheers

  • WooCommerce Dynamic Pricing now supports the Groups plugin. You can control if an advanced rule applies to specific groups, or use the new Simple Group module for applying price adjustments to all members of a group.

  • James

    For the love of goodness. all I want to do is get the current logged in user’s group. either group name or group id i don’t care. and not in shortcode, in php.

    How do I do that?

  • James

    In other words, here is my code, which has worked and suddenly stopped working unexplainably:

    $user = get_current_user_id();
    if ( Groups_User_Group::read( $user, ’1′ ) ) { echo “”; }
    elseif ( Groups_User_Group::read( $user, ’2′ ) ) { echo “”; } else { echo “”; };

    Now no matter what, only the third case gets activated and it is always prompting three.css. why?

    • antonio

      Hi,
      you can get user’s groups, for example:

      $user = new Groups_User( get_current_user_id() );
      $groups = $user->groups;
      foreach ($groups as $group) {
      echo $group->name . ",";
      }

      cheers

      • James

        Thanks

        So this adds all the groups this user belongs to as an Array in $groups ?

        • antonio

          yes, in this case $groups is an array.
          cheers

          • James

            Well I am using the following code, I am just trying to check if they belong to one particular group and execute code, but I don’t want to loop it because I only want it to run once:

            $user = get_current_user_id();
            if ( Groups_User_Group::read( $user, ’28′ ) ) { echo “”; }
            elseif ( Groups_User_Group::read( $user, ’29′ ) ) { echo “”; } else { echo “”; };

            The problem is that this code seems to work and suddenly stops working. and then suddenly works again.

          • James

            It doesn’t let me reply to your last comment for some reason.

            In any case, i am not sure what that code in that comment does exactly and how to I apply it to my case. in what way does it differ from what I’ve done?

            Thanks

            • antonio

              Hi,
              I thought it best to use the group name, in case the id was wrong.
              But you can try:

              if ( class_exists('Groups_User_Group'))
              echo "OK";
              else
              echo "ERROR Groups is not loaded"

              to verify that your code is not launched before loading groups.
              cheers

  • Seb D.

    Hi !

    One little ask.
    Is there a way, when creating/editing a page, to choose access by group, and not by capabilities ?

    Sébastien

    • antonio

      Hi,
      you can restrict some content with groups, but total access must be with capabilities.
      You could create one capability per group, and call it equal.
      cheers

  • Seb D.

    Another two questions :)
    Is it possible to rename the Registered Group (Membre, in french) ?
    I can rename it in the database, but i would like to be sur no issues came with that.

    Remove the long list of capabilities in Groups > Capabilities does have an impact with the real wordpress capabilities ?

    Thanks !

    • You shouldn’t rename it in the database, the Registered group is referenced internally by name and should not be removed or renamed.

      You can remove the capabilities but it will effectively remove a lot of the advantages the Groups offers.