Groups

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

Extensions

New Groups Restrict Categories and Groups Import Export.

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

Features

User groups

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

Groups hierarchy

  • Supports group hierarchies with capability inheritance

Group capabilities

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

Access control

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

Easy user interface

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

Sensible options

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

Access Control

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

Framework

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

Multisite

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

Your opinion counts

You & Groups

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

Feedback

Feedback is welcome!

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

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

Twitter

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

Introduction

Content Access Control

Access restrictions on posts

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

Content visibility for members and non-members

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

Example: Limiting visibility of enclosed content to registered users.

[groups_member group="Registered"]

Only registered users can see this text.

[/groups_member]

Content visibility based on capabilities

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

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

[groups_can capability=”edit_posts”]

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

[/groups_can]

Integration in the ‘Users’ menu:

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

Sections in the ‘Groups’ menu:

Groups

Here you can:

  • add groups
  • remove groups
  • assign capabilities to groups

Capabilities

This is where you add, remove and manage capabilities.

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

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

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

Options

Administrator override :

Administrator overrides can be turned off.

Permissions :

For each role these permissions can be set:

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

Testing the plugin :

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

Shortcodes

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

Download

Download the Groups plugin on WordPress.

2,377 Responses to Groups

  1. Bharath October 19, 2012 at 1:05 pm #

    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.

    • bharath October 26, 2012 at 5:58 am #

      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.

  2. Jaybe October 18, 2012 at 8:14 pm #

    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!

    • kento October 19, 2012 at 8:24 am #

      Thanks Jaybe 🙂
      That would be possible if the access restrictions box offered to grant access when a user does not have a capability, although it’s a bit contrary to the design ideas of Groups. An easy solution for you is the Menu Item Visibility Control plugin.

  3. Paul October 18, 2012 at 6:33 am #

    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?

    • kento October 19, 2012 at 8:11 am #

      Where do you see these ancestors? Screenshot?

  4. Matt October 17, 2012 at 12:57 pm #

    @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.

    • kento October 19, 2012 at 8:10 am #

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

      • Matt October 19, 2012 at 8:14 am #

        @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.

        • kento October 19, 2012 at 8:42 am #

          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!';
          }

  5. Gene October 12, 2012 at 6:29 am #

    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

    • kento October 17, 2012 at 12:32 pm #

      Hi Gene, yes you can restrict access to products. With the latest release, you can also choose which post types should offer the access restriction box.

    • kento October 19, 2012 at 8:10 am #

      PS: You can’t restrict access to categories with this.

  6. Casey October 11, 2012 at 3:17 pm #

    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??

    • Casey October 11, 2012 at 3:49 pm #

      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(); ?

      • Casey October 11, 2012 at 4:12 pm #

        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.

    • kento October 17, 2012 at 12:31 pm #

      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.

      • casey October 19, 2012 at 2:42 pm #

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

        }

        • casey October 19, 2012 at 2:43 pm #

          $usergroup is a var that comes from my dropdown select. Represents the group name I am pulling from.

        • kento October 25, 2012 at 5:15 pm #

          You should place this in its own plugin instead of hacking the core plugin, otherwise it will be a PITA to maintain 😉

          • casey November 19, 2012 at 5:46 pm #

            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. Feel free to use this Kento or anyone else.

            http://hardwiredmedia.com/extendgroup.zip

            This will keep your updates from affecting the code I made.

  7. David October 9, 2012 at 12:45 am #

    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?

    • kento October 15, 2012 at 8:33 am #

      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.

  8. Matt Walsh October 8, 2012 at 12:59 pm #

    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?

    • Casey October 11, 2012 at 3:29 pm #

      do_shortcode(‘[groups_user_groups]‘);

      • kento October 15, 2012 at 7:29 am #

        @Matt Please refer to this reply to Nicola who asked this question previously.
        @Casey that would render the current user’s list of groups

        • Matt October 16, 2012 at 8:52 am #

          @kento

          I have tried this but with no luck.

          What is supposed to go in the $user_id section?

          Also If I wanted to add more I could just use else and elseif statements?

          $user_id = …;
          $group_id = Groups_Group::read_by_name( ‘Registered’ );
          if ( Groups_User_Group::read( $user_id, $group_id ) ) {
          // do stuff
          }

          • kento October 17, 2012 at 12:38 pm #

            From what you said earlier, you would do $user_id = get_current_user_id();

  9. Lucas Stark October 6, 2012 at 5:58 pm #

    @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.

    • kento October 8, 2012 at 9:46 am #

      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.

  10. jmdarter October 3, 2012 at 7:30 pm #

    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?

    • kento October 3, 2012 at 8:39 pm #

      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).

      • jmdarter October 11, 2012 at 4:28 pm #

        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-

  11. James October 3, 2012 at 8:40 am #

    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.

  12. Keith September 29, 2012 at 2:25 pm #

    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.

    • Keith September 29, 2012 at 2:27 pm #

      Update: It appears to add them, as I can see in the drop down (parent) when adding a new group. They are just not showing on the main Group page list.

      • kento September 29, 2012 at 11:06 pm #

        Do you have any filters set on the Groups screen? If yes, then probably that’s why the new groups aren’t showing.

  13. Peter Willis September 28, 2012 at 3:25 pm #

    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

    • kento September 29, 2012 at 10:22 am #

      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.

      • Virgo March 6, 2013 at 2:49 pm #

        I was just searching for this option too.
        The ability to assign a group while an administrator creats a new user.
        It’s possible to have this?

        thanks, this plugin is wonderful!!!

        • kento March 9, 2013 at 11:51 am #

          Many thanks Virgo, I’m planning to get to this soon 🙂

  14. Art Butcher September 25, 2012 at 3:42 pm #

    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).

    • kento September 26, 2012 at 9:38 am #

      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 😉 ).

  15. Meayen September 25, 2012 at 3:41 am #

    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

    • kento September 26, 2012 at 9:35 am #

      Have you enabled read_officers for access control on the Groups > Options admin page?

      • Meayen September 26, 2012 at 3:26 pm #

        Kento,

        Thank you, not sure how I forgot that step on the second capability.

        Meayen

  16. Akmal Izzat September 24, 2012 at 12:31 pm #

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

    • kento September 26, 2012 at 9:33 am #

      Documentation pages are here http://www.itthinx.com/documentation/groups/ (in progress) and a lot of useful information is on the plugin page http://wordpress.org/extend/plugins/groups/

      • Akmal Izzat September 26, 2012 at 7:09 pm #

        i see, so there’s no completed documentation right now, is that right?

        this plugin would be cool when it’s completed, can’t wait to use it. i hope you can simplify it by adding more features to the Groups tab just like what Membership did..

        • kento September 27, 2012 at 9:42 am #

          No that’s not right. Everything you need to use it is documented at the pages I mentioned before. What is incomplete is the online API documentation, but if you need that you can refer to the code as it is very well documented.

  17. Juan Amor September 23, 2012 at 4:30 pm #

    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?

    • kento September 26, 2012 at 9:28 am #

      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.

      • Juan Amor September 29, 2012 at 12:10 pm #

        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

        • kento September 29, 2012 at 11:05 pm #

          Great, I’ll review and add it to the repository after checking the issues you commented as well. That was really quick 🙂

  18. Jacob September 22, 2012 at 2:56 am #

    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?

    • kento September 26, 2012 at 9:16 am #

      In which context? I mean which plugins are you using?

  19. Jacob September 21, 2012 at 5:18 pm #

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

  20. bharath September 21, 2012 at 12:06 pm #

    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.

    • kento September 26, 2012 at 9:53 am #

      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.

  21. Nicola Elvin September 21, 2012 at 12:03 pm #

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

    • kento September 26, 2012 at 9:51 am #

      No, why would you want to change it?

  22. bharath September 21, 2012 at 11:54 am #

    [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.

    • kento September 21, 2012 at 11:56 am #

      You are mixing lower and upper case versions of the Group names. It won’t work like that, you have to use the group names exactly as they are defined.

  23. Nicola Elvin September 21, 2012 at 11:39 am #

    brilliant, thank you!

  24. Nicola Elvin September 21, 2012 at 11:16 am #

    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.

    • kento September 21, 2012 at 11:32 am #

      Voilà 🙂

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

      • Jaybe October 18, 2012 at 9:33 pm #

        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.

        • kento October 19, 2012 at 8:53 am #

          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 ) ....

  25. Nicola Elvin September 21, 2012 at 9:58 am #

    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’]

    • Nicola Elvin September 21, 2012 at 10:25 am #

      Its ok, I figured it out. I’m now just trying to use the shortcode in php template.

      • kento September 21, 2012 at 11:06 am #

        Ok great, feel free to post your solution, it might help others.

  26. Jacob September 13, 2012 at 5:21 pm #

    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.

    • kento September 21, 2012 at 11:05 am #

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

      • Sam May 3, 2013 at 11:02 pm #

        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 May 4, 2013 at 6:45 am #

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

          • Sam May 4, 2013 at 1:16 pm #

            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 May 8, 2013 at 7:16 am #

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

              cheers

  27. Kelechi September 10, 2012 at 5:48 am #

    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!

    • kento September 10, 2012 at 12:23 pm #

      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.

  28. Steven Holland September 5, 2012 at 12:42 am #

    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

    • kento September 10, 2012 at 10:56 am #

      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 September 11, 2012 at 3:50 am #

        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.

  29. Bharath September 2, 2012 at 3:43 pm #

    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.

    • kento September 4, 2012 at 7:42 pm #

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

      • bharath September 5, 2012 at 6:30 am #

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

      • bharath September 5, 2012 at 8:23 am #

        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.

        • kento September 10, 2012 at 11:07 am #

          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.

          • bharath September 12, 2012 at 7:22 am #

            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.

            • kento September 21, 2012 at 11:02 am #

              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"]

  30. Kelechi September 1, 2012 at 9:43 am #

    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

  31. Chris LEma August 31, 2012 at 8:46 pm #

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

  32. Jason August 25, 2012 at 11:26 pm #

    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.

    • kento August 28, 2012 at 11:04 am #

      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 May 27, 2013 at 8:58 am #

      Hi,
      you can take a look to Groups2MailChimp.
      cheers

  33. Ty August 25, 2012 at 10:08 pm #

    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?

    • kento August 28, 2012 at 10:58 am #

      You can let users join specific groups, see the shortcodes documentation on that.
      Most of the default capabilities are built-in WordPress capabilities but you can define your own as well. Capabilities can be assigned to groups to grant those to members of a group.

  34. Ty August 25, 2012 at 7:23 pm #

    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

    • kento August 25, 2012 at 9:34 pm #

      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.

  35. AJM August 14, 2012 at 5:48 pm #

    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

    • kento August 16, 2012 at 3:30 pm #

      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 October 20, 2012 at 3:50 am #

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

        • kento October 25, 2012 at 5:31 pm #

          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 January 17, 2013 at 7:58 pm #

            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.

  36. sue August 7, 2012 at 10:04 pm #

    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?

    • kento August 9, 2012 at 8:20 am #

      You can add them to Groups on the normal Users menu 🙂

  37. Dan Feeley August 7, 2012 at 7:33 pm #

    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!

  38. rmp73 August 6, 2012 at 5:41 pm #

    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.

    • kento August 9, 2012 at 8:17 am #

      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.

  39. Mulegoat July 31, 2012 at 10:57 am #

    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

    • kento August 9, 2012 at 8:15 am #

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

  40. Iggi July 25, 2012 at 1:46 pm #

    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

    • kento July 25, 2012 at 5:49 pm #

      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.

      • Iggi July 26, 2012 at 5:30 am #

        Shot. Somehow I just new I was missing something. Thanks for making it clear and the quick response. Stoked!

        Iggi

        • kento July 26, 2012 at 9:06 am #

          You’re welcome 🙂

  41. Christopher July 18, 2012 at 5:38 pm #

    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!

    • kento July 18, 2012 at 8:01 pm #

      Thanks for using it 🙂

      Regarding 404s, have a look at this comment above please, there are some plugins around that should cover what you need.

  42. Michael July 17, 2012 at 8:26 am #

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

  43. Zoe July 17, 2012 at 3:17 am #

    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!

    • kento July 17, 2012 at 11:05 am #

      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 July 17, 2012 at 1:32 pm #

        Fantastic, thank you!

      • Zoe July 17, 2012 at 3:10 pm #

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

        • kento July 18, 2012 at 10:30 am #

          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.

          • Zoe July 20, 2012 at 2:40 am #

            The capabilities one isn’t working for me. I’ve tried with both the capability name and the ID, and neither seems to work. Any ideas?

            • kento July 24, 2012 at 9:33 pm #

              I tried it and it worked for me, how did you use it?

          • Zoe July 25, 2012 at 4:16 pm #

            It is working, sorry! I was testing it logged in as an admin, forgetting that I had to use a different user to test capability restrictions.

            Thanks again for your help!

            • kento July 25, 2012 at 5:46 pm #

              You can also deactivate the admin override from the options.

      • Arjen March 4, 2013 at 2:18 pm #

        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 March 4, 2013 at 4:39 pm #

          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

          • Arjen March 4, 2013 at 5:01 pm #

            Thanks a lot for your quick reply.
            It works perfect!

            thank you

          • jaybe March 4, 2013 at 5:11 pm #

            How would one negate, to determine a user is NOT a member of a Group? Thanks!

            • antonio March 4, 2013 at 5:18 pm #

              Hi jaybe,
              change last instruction by:

              return ! ($result1 || $result2);

              cheers

      • Milque February 27, 2014 at 4:47 pm #

        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!

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

          Hi, WooSidebars provides a new custom post type which is not intended to be handled by Groups (because of how it is defined internally). Would Custom Post Widget be an option?

  44. Nancy Nardi July 17, 2012 at 3:05 am #

    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?

    • kento July 17, 2012 at 10:36 am #

      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 July 17, 2012 at 2:45 pm #

        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 July 17, 2012 at 2:49 pm #

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

          • kento July 18, 2012 at 10:21 am #

            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.

        • kento July 18, 2012 at 10:19 am #

          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 November 7, 2012 at 4:36 am #

      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..)

  45. Arturol July 15, 2012 at 6:15 pm #

    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,

    • kento July 17, 2012 at 10:14 am #

      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.

  46. Paul July 13, 2012 at 8:44 pm #

    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

    • kento July 13, 2012 at 8:52 pm #

      Of what nature are the products they can access?

      • Paul July 13, 2012 at 8:57 pm #

        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.

        • Paul July 13, 2012 at 9:01 pm #

          This code looks similar to what I’m looking for but I’m an amateur coder…..: http://www.woothemes.com/support-forum/?viewtopic=78163

          • kento July 13, 2012 at 10:38 pm #

            You can forget all the role stuff with Groups and with Groups WooCommerce the users are assigned to groups automatically.

        • kento July 13, 2012 at 10:36 pm #

          Yeah got to that one quick 😉
          Are you sure you mean role? This rather sounds like you’re using a custom groups capability – gold_member. Right? If that is so, then one solution to the instant access question would be to include a link to a downloads section and grant access to files through Groups File Access.

          • Paul July 14, 2012 at 12:04 am #

            Fantastic!! A far easier way to achieve the exact same functionality!

            Thanks for all your help and your speedy responses.

            • kento July 14, 2012 at 9:58 am #

              My pleasure 🙂

  47. Michael July 13, 2012 at 5:01 pm #

    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

    • kento July 13, 2012 at 8:37 pm #

      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 July 14, 2012 at 10:01 am #

        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?

        • kento July 17, 2012 at 10:02 am #

          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 July 17, 2012 at 2:25 pm #

            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.

            • kento July 18, 2012 at 10:11 am #

              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.

  48. Arturol July 13, 2012 at 4:55 pm #

    Yes, i have alreday tried this plugin, i’m using it 😉

    • kento July 13, 2012 at 8:36 pm #

      Great. Can you share some performance results?

  49. Arturol July 13, 2012 at 2:22 pm #

    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

    • kento July 13, 2012 at 4:19 pm #

      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.

  50. Arturol July 13, 2012 at 2:02 pm #

    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

Leave a Reply

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

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

Share