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,375 Responses to Groups

  1. John June 11, 2019 at 7:01 pm #

    Hi,

    On my event pages (using The Events Calendar by Tribe), I have two kinds of tickets (using Event Tickets Plus and WooCommerce), one with a member price, the other with a guest price.

    Using the plugin Groups by ithinx, I edit the ticket on its product page to restrict the visibility of that product to the group “Members”, so that on the event page, if someone is not a member of the group “Members”, they cannot see that ticket. This works quite well, except…

    Whenever I edit an event that is visible to everyone which has both member and non-member tickets, as soon as I save any revisions to the event, the group restriction of the visibility of the member ticket gets removed so that it is also visible to everyone. (It seems to me that whatever restrictions the event has get transferred to the tickets.) I then have to edit the ticket again on its product page to restrict the visibility. Sometimes I forget to do this, and it costs me money.

    This happens the other way around as well: if an event is visible to Members only, the tickets also have their readability restricted to members (which is not a problem, but the other way around is).

    Have tested and confirmed this happens on a WordPress site with Twenty Seventeen theme, and just 6 plugins (Event Tickets, Event Tickets Plus, Groups, The Events Calendar, WooCommerce, and “Classic Editor” (disables Gutenberg editing). WordPress and all plugins are up to their most recent versions.

    The website given in the form is my test website.

    P.S. I have tried assigning the product to a category that is restricted to Members only, and then non-Members cannot see product pages of tickets in that category, but on the event page, non-Members can still see the ticket.

    • Kento June 13, 2019 at 8:18 pm #

      Hi John,

      I’m not sure why this happens to be honest, but if you have a protected product and it gets ‘unprotected’, this looks like the restriction gets lost somehow. Given that you are trying this with what seems to me a minimal configuration but still get the issue, it’s probably an incompatibility or an error of some sort that interferes. Have you checked if you get any console errors in the browser by any chance? I’m just wondering if it’s related to a simple thing …

      Cheers

      • John June 13, 2019 at 9:22 pm #

        Hi Kento,

        Given that it happens with minimal plugins, and it also happens the other way around (if an event is visible to Members only, tickets with no restrictions also have their readability restricted to Members), it seems to me not to be an incompatibility, but a process design flaw. That is, when the event page is saved, the group restriction properties of the event are applied to all the elements of the event by the plugin. By design. But… is it The Event Calendar plugin or the itthinx plugin that is doing the saving and applying? If it’s yours, then it seems to be an easy (although maybe not high-priority) fix. If it’s the Event Calendar that’s doing that… well, then I’m guessing I’ll get the standard answer from both of you (“we don’t guarantee compatibility”).

        While I am a great troubleshooter and pretty good at identifying conflicts and potential causes of problems, that pretty much applies at “high levels” (as opposed to “low levels”) of the tech. So when you ask if I get any console errors in the browser… I’m not a programmer, I wouldn’t know what errors to look for, and I’m not even sure how to go about looking for console errors.

        • Kento June 14, 2019 at 8:51 pm #

          Hi John,

          Thanks for your detailed comment on this. We usually try to solve incompatibilities or issues where reasonable and doable, I wouldn’t rule out any further looking into it 🙂

          What I was referring to is the browser console. When you use e.g. Firefox and open the developer tools, you get a tab labeled “Console” and you can see any messages produced while the page loads (make sure to reload the page bypassing the cache: Hold down the Shift key and left-click the Reload button). The reason why I am asking is to see if there are any Javascript errors involved – these would show up in the console part …

          Cheers

  2. Web May 28, 2019 at 4:26 pm #

    Is there a way i can exclude some groups e.g. Default group i.e “Registered” from groups array?

    Groups_Group::get_group_ids() and Groups_Group::get_groups()

  3. Alex May 25, 2019 at 4:27 pm #

    I would like to create an action that removes a user from a group if/when they click a button. Is there a way to do this? (I’m not a great coder, so I’d appreciate as much detail as you can provide). Thank you!

  4. Manoj May 24, 2019 at 4:58 pm #

    Is there a way i can get all groups array.

    • Kento May 24, 2019 at 6:24 pm #

      Yes, Groups_Group::get_group_ids() and Groups_Group::get_groups() - these are well-documented in the code, although we should add some examples http://docs.itthinx.com/document/groups/api/examples/

      • Manoj May 24, 2019 at 10:13 pm #

        Yes, it worked. Thankyou.

  5. Anthony Randall May 16, 2019 at 9:38 am #

    Hi Support

    Is there a way to notify a user with a welcome email when they first join a specific group.

    I’ve downloaded the notifications add-on, but that sends a notification to users who join
    ANY group. I just want users who join one specific group to receive a custom welcome email.

    Thanks

    • Kento May 18, 2019 at 12:44 pm #

      Hi Anthony,

      As it doesn’t currently provide an option to do this on a per-group basis and also doesn’t have a filter implemented that could be used, you would need to create an action hooked on groups_created_user_group that removes the Groups Notifications action on the same hook, unless you want the notification to get through.

      Cheers

  6. Lynne May 7, 2019 at 8:50 pm #

    Hi,
    We need a means to populate our groups to our products. We have around 2000 products involved.
    How can we best group mark our products?
    Thank you!

    • Kento May 13, 2019 at 4:52 pm #

      Hi Lynn,

      I assume that refer to restricting access to sets of products based on groups – you can use the bulk actions available on top of the product list where you will find the access restriction option similar to when you edit a product individually. The Access Control has more information on restricting access if you want to have a look.

      Cheers

  7. MM May 2, 2019 at 7:49 pm #

    Hi there — I just got this plugin today and have to say, it’s very easy to use and the functionality is great! I do have an issue — my [groups_non_member] shortcode isn’t working. Instead, a user not in the group gets an Error 404 message, even though the page uses the shortcode and has a message to display. Any guidance to make the non-member shortcode work? Thanks!

    • Kento May 2, 2019 at 8:45 pm #

      Hi MM,

      Great to hear that you find it useful! Many thanks for you kind comment 🙂

      Regarding the shortcode, it won’t produce a 404 for a page, you probably also have an access restriction set directly on the page – please have a look here http://docs.itthinx.com/document/groups/access-control/ for details on how these work.

      I would assume that you’ve protected the page with a group and placed the shortcode on the same page, in that case, any unauthorized user would not even get to see the content protected by the shortcode because access to the protected page itself isn’t granted.

      Cheers

      • MM May 2, 2019 at 8:56 pm #

        Ack — you’re 100% right. Got it fixed — thank you VERY much!

  8. Michael Broughton April 11, 2019 at 7:11 am #

    Hi,
    I am using WP All Export jobs triggered by CRON for scheduled data exports from my WooCommerce websites.

    When the export jobs are triggered manually, everything works as expected and there are no issues. However, when the job is triggered by CRON only variable products are exported and simple products are not picked up by the job.

    After much testing I have identified that this issue appears when the Groups plugin is active on the site. Subsequently, there is something in the plugin that is preventing CRON jobs from accessing all the product types.

    Any idea what this issue could be?

    Thanks!

    • Kento April 22, 2019 at 7:48 pm #

      Hi Michael,

      I just saw you posted your question here, too – in case you haven’t read my reply over on your post, this is what I recommended:

      I don’t see any relation to Groups itself – but the first thing that I would recommend to check is that PHP memory limits are not exceeded. It’s often the case that you get the symptoms you describe when that happens, disabling a plugin reduces the overall memory footprint and then it appears that the plugin was the culprit.

      It this is still an issue, try raising the memory limit and check it please. I’ll mark this as resolved but feel free to follow up if you still have issues after trying the suggestion.

      Cheers

      • michaelbroughton April 23, 2019 at 10:22 am #

        Hi Kento,
        Thanks for the feedback on this.

        Taking your advice I have been in contact with my hosting provider to double the PHP memory allocation and check the PHP error log but we can not find any issue with the PHP memory allocation. Additionally, I am doing my testing with just the minimum number of plugins activated and the root cause remains activation of the Groups plugin.

        Could I ask you to take another look into this?

        Just to make clear that I have the plugin network activated on a multi-site network, so please take that into consideration during your testing.

        Many thanks,

        Michael

        • Kento May 2, 2019 at 7:55 pm #

          Hi Michael,

          I just wanted to follow up with you as George is still investigating this and will reply to you on the topic.

          Cheers

          • Michael Broughton May 3, 2019 at 12:51 am #

            Great, thanks for the follow-up Kento. Waiting on George then!

            Michael

          • Michael Broughton May 10, 2019 at 5:13 am #

            Hi Kento,
            Just a quick update to let you know that I have not heard back from George for a couple of weeks, so I am still waiting for your feedback on what the issue is.

            Also, just to let you know that I updated to the Groups 2.7.0 version you released this week, but unfortunately the issue persists so no goog news there.

            Many thanks

            • Kento May 13, 2019 at 4:12 pm #

              Hi Michael,

              I’ve just checked and he has followed up today on the topic. Seems like we couldn’t replicate the issue you get so I would assume it’s an issue with your site’s particular setup. I would recommend to have a look at the installation he mentions and contrast it with your’s. Please follow up with him on the topic in any case.

              Cheers

  9. REDA March 20, 2019 at 9:23 am #

    Hello,

    I want to know if it’s possible to subscribe front-end to a group?
    This is for an educational purpose!

    thanks

    • Kento March 20, 2019 at 11:02 am #

      Hi,

      Thanks for asking! Yes it’s possible, a simple way to let users join a group is by using the [groups_join] shortcode. Let’s assume that you have a group called Yoga and you want to let people join that group, you would simply put [groups_join group="Yoga"] on a page.

      Cheers

  10. pavel_lishin March 13, 2019 at 4:11 pm #

    Howdy,

    I’m seeing something unexpected.

    I create two capabilities (“blue” and “orange”) and two corresponding groups (“Blue” and “Orange”), and two corresponding users (“Mr. Blue” and “Ms. Orange”).

    I then create two new corresponding categories (“blue” and “orange”) using the Restrict Categories plugin (https://www.itthinx.com/shop/groups-restrict-categories/), and restrict them to the respective groups.

    I then create a new post (“Hello World”) and add it to the Blue category. Logging in as Mr. Blue, I can see this post; logging in as Ms. Orange, I can’t. This is expected.

    But if I then add this post to both the Blue and Orange category, I cannot see the post as either Mr. Blue or Ms. Orange.

    I would expect the restriction to work on an “or” basis – since Mr. Blue is in the Blue group and has the blue capability, I expect to see the post, despite it also belonging to the orange category.

    Am I doing something wrong? Or is this how we expect this to work? And if so, how *do* I grant a given post to multiple groups at once without hierarchies? (Blue and Orange groups don’t have a hierarchical relationship.)

    • pavel_lishin March 13, 2019 at 4:47 pm #

      Oh, and with further experimentation, it appears that this is *not* the case if I modify group membership for the post itself – assigning the post to both groups lets a member of either one view it.

      • Kento March 17, 2019 at 6:54 pm #

        Hi Pavel,

        Yes that seems correct. When you have distinct categories related that require distinct groups to grant access and the user does not satisfy both, it will correctly deny access. If you were to assign both groups to the same category, then the choice would be any of the groups.

        Cheers

        • Pavel March 18, 2019 at 1:16 am #

          I’m still kind of confused; why does it work one way for categories, but a different way for posts?

          • Kento March 19, 2019 at 3:15 pm #

            On a post, when you restrict by a couple of groups, being a member of one of them is sufficient to view it. The same thing applies to categories, when you restrict a category with two groups, it’s ok to belong to one of those groups to see the related posts.

            When you use two different categories that use different groups, then the system will consequently require you to be a member of both.

  11. Afolabi Osinowo February 27, 2019 at 3:53 pm #

    Hello developer i installed affiliates free..It created for me the affiiiate link:Your affiliate URL:
    https://www.lingerie-hub.com/?affiliates=2

    Use this code to embed your affiliate link:
    <a href=”https://www.lingerie-hub.com/?affiliates=2″ rel=”nofollow”>Affiliate link</a>

    1.Please may i know what link my affiliates will use when they sign up between these two links?

    2.Please is it also possible to know whose affiliates’ referral buys on my store….

    (I am working with the free plugin ,right now!)

    • Kento March 5, 2019 at 9:06 am #

      Hi,

      Please update your installed version to the latest release and use the new affiliates dashboard instead. Edit the affiliate area and leave only this shortcode on it:

      [affiliates_dashboard]

      You can see details on it on this documentation page.

      Cheers

  12. Joy February 23, 2019 at 4:14 am #

    Is there a way to bulk edit products, or do groups have to be added one by one? Thanks!

    • Kento February 25, 2019 at 9:16 am #

      Hi Joy,

      Yes you can assign groups to several products in bulk, simply use the usual Bulk Actions on top of the table. Optionally, you can use Groups Restrict Categories to handle access restrictions based on categories and other taxonomies.

      Cheers

  13. Joe February 22, 2019 at 2:19 pm #

    Greetings,
    I am need to simply display the user’s current group they belong to on the page. Is there a shortcode I can use to display this? For example, something like,

    “Member’s Current Group = [group_name]” (Where the group name pulls from the database and displays what group the user currently belongs to).

    Any simple way to achieve this with a current/existing shortcode strategy or would it have to be custom coded?

    Thanks!

  14. optec February 20, 2019 at 12:38 pm #

    Hi Kento,

    Love the plugin. Just having an issue with making it work with Ajax Search Pro – one of you guys put some code up to make it work by editing the functions.php file, but I’m STILL seeing group search results in my drop down. The products are blocked, but I can still see them…

    Any views?

    Cheers

    stu

    • Kento February 25, 2019 at 9:35 am #

      Hi,

      Great to hear that you love it! I can highly recommend to use the WooCommerce Product Search search engine, not only does it provide a fully working live search that works beautifully with Groups, it has many other features that you will love. As its lead developer, I can only recommend it!

      Cheers

  15. Dennis Argue February 16, 2019 at 9:43 pm #

    Converting an existing school WIX web site to a WordPress site. There are a handful of pages that we need to restrict to approved people only (those registered at the school). I would like to initially upload or enter the email addresses for authorized people. But I could live with them registering (which would not get them access to anything more than public) and I would assign them to an “Approved” group which would then grant them access to those restricted pages. My simple question is, would we get an email letting us know that someone registered so that we could review their request and add them to the “Approved” group or let them know their request was denied?

    I’d really love to be able to query the MySQL database to see if their email address exists on a registered students record. But can live without that for now. Maybe a future project…

    • Kento February 26, 2019 at 1:06 pm #

      Hi Dennis,

      That sounds great, thanks for considering Groups for your project.

      Regarding the registration emails, that’s something WordPress would do automatically, it doesn’t depend on Groups. So when you have a new user register, you would get a notification to the site administrator’s email.

      As an efficient solution to import a large amount of users and have them assigned to group(s) automatically upon import, we offer Groups Import Export. This would spare you and them from having to register individually, and as it would be based on your existing list of users, you wouldn’t have to map them manually to the appropriate groups. You would also be able to import different sets and assign them to different groups as needed.

      Regarding queries to the database for existing users/emails, you could also use the search function in the Users section of the WordPress dashboard.

      I hope that all of this helps you further.

      Cheers

  16. Ricky February 12, 2019 at 8:01 am #

    Hi! Is there any create a new group shortcode for frontend loggedin user such as editor or contributor?

    • Kento March 5, 2019 at 8:50 pm #

      Hi Ricky,

      Thanks for asking but currently the shortcodes included don’t offer such an option. It’s something we’re working on among other things though, but I can’t really promise on an exact ETA for this type of feature yet.

      Cheers

  17. Robbie February 11, 2019 at 1:48 pm #

    When you have a user that is not linked to any groups and you visit the “All Users” page to get a list of users you will get a small PHP warning at the top of the page and also in the error log:

    PHP Warning: count(): Parameter must be an array or an object that implements Countable in wp-content\plugins\groups\lib\admin\class-groups-admin-users.php on line 358

    It seems that the $groups variable is null for that specific case and calling count() on that triggers the error. Changing the line to this seems to solve it:

    if ( $groups && count( $groups ) > 0 ) {

    Perhaps this, or a better fix can be included? I know it is only a minor warning everything works just fine, but would be nice if it could be fixed.

    Thanks

    • Kento March 5, 2019 at 9:12 pm #

      Hi Robbie,

      Many thanks for pointing that one out! I assume that you have WP_DEBUG_DISPLAY defined as true so this is displayed, if you set that to false the notice won’t be displayed. But we should of course take care of it so it isn’t produced at all.

      Cheers

  18. Michel February 8, 2019 at 1:33 am #

    Is there a REST API that I can use for assigning a user to a WooCommerce Group?

    I’m using the Groups Plugin and the only documentation I see is:
    http://api.itthinx.com/groups/
    http://docs.itthinx.com/document/groups/api/examples/

    However, I don’t understand how I can use this within a script like Python (or CURL)

    I’m using Python w/ the WooCommerce API to update orders and I would like to use a Group API to assign (or remove) a user from a group. Everything I see is listing PHP code.

    Any help would be greatly appreciated! Thanks!

    • Kento March 5, 2019 at 9:14 pm #

      Hi Michel,

      Good question, we’re currently working on the REST API for Groups among other things. Currently it’s not possible to achieve this other than via Groups’ PHP API, so if you’d like to modify things via Python and REST, you’d have to write up your own handler if you need a solution right now.

      Cheers

  19. Jonathan February 5, 2019 at 2:44 pm #

    Hello Kento,

    Is there a way to prevent users who create an account from being automatically assigned to the Registered Group or assigned to a different group upon creating an account? For example, customers who create an account to access the site to purchase via WooCommerce.

    Please let me know if you need more details.

    Thank you.

    • Kento March 5, 2019 at 9:39 pm #

      Hi Jonathan,

      The Registered group is always assigned to new users so one can easily address those as a group. This is not something that you would want to remove by design as it serves a very useful purpose. If you need to distinguish registered users by group in combination with purchases via WooCommerce, then you can use Groups WooCommerce which allows you to assign users to groups based on the product purchased.

      Cheers

  20. jordi sanchez January 22, 2019 at 12:05 pm #

    Hi,

    I have installed your amazing plugin. I would like that when I save my custom post type, depending on the group the publisher belongs to, save the group on custom post type added. Maybe is a problem of my wordpress? I use it with custom post types UI and Advanced Custom Fields plugins.

    Many thanks,

    • Kento January 24, 2019 at 9:31 am #

      Hi Jordi,

      Thanks for your kind comment on Groups!

      You can achieve this by creating a little plugin that acts when a post is saved. You would need to create a hook on the save_post action. You can obtain the groups that the author can use to restrict access using Groups_Post_Access_Meta_Boxes::get_user_can_restrict_group_ids() and for each of the groups obtained, assign them to the post using Groups_Post_Access::create( array( 'post_id' => $post_id, 'group_id' => $group_id ) ).

      I hope that helps!

      Cheers

  21. Brian January 8, 2019 at 6:59 pm #

    Is it possible to add users to a group based on their user role when they register?

  22. Alex December 31, 2018 at 7:33 pm #

    Hi Kento,

    Thank you for this amazing plugin! I have an online program that allows users 45 days to access the content but the access doesn’t start from the date of purchase but rather from a certain day in the future (so adding a certain number of days access in the Groups WooCommerce plugin won’t work). Is there a way to set the expiration date of a group universally?

    So an example: On February 15, I would like the group “Online Program” to be removed from all Users who have this group in their Groups field, just as if I had come by and deleted it manually.

    Is this possible? Thank you in advance!

    • Kento January 9, 2019 at 3:40 pm #

      Hi Alex,

      Thank you very much for your kind comment!

      To have all users removed from a particular group at a specific date, you currently have two options:

      1) Do it manually – filter the users by group, select all and remove them from the group. See the bulk actions described in the Memberships section of the documentation.
      2) Run a scheduled event which executes a function that does Groups_User_Group::delete( $user_id, $group_id ); for each user in the group.

      The first one is easy to do if you simply want them removed and set yourself a reminder for that date. The second is doing the same but of course you need to code it or have someone code it for you. I hope that this helps a bit!

      Cheers

  23. Rick December 27, 2018 at 9:12 pm #

    Thanks, Kento for taking the time to reply. Much appreciated. I read your suggested WordPress password page and it will work through more clumsy than the (expiring) plugin we are using now. This will get us across the forced changeover to php7.2. Best wishes for the new year. Rick

    • Kento December 31, 2018 at 12:48 pm #

      Hi Rick,

      I’m happy to hear that this is a solution for you, wishing you a great start into the new year! 🙂

  24. Rick December 27, 2018 at 2:46 am #

    Can Groups Plugin do this: I manage an organization’s website most of which is open to the public. There is one area that needs to be accessible to members only, ie members/xxx/xxx. I need this whole area to have one sign-in password when someone clicks on “members” on the main menu, however, those who sign in are NOT REGISTERED WITH THE SITE. Instead, they get their password via bulk email to the membership and just enter that when accessing the area. The reason for this is there are over 100,000 members and I couldn’t possibly keep registrations up to date, especially because I would not know who has ceased membership. I sincerely hope there is a way to accomplish this with Groups plugin. Thanks.

    • Kento December 27, 2018 at 12:59 pm #

      Hi Rick,

      I appreciate your consideration of Groups to approach this but based on what you describe, it wouldn’t be a good match. In fact, WordPress already provides a very simple password protection for pages which seems to be more in line with what you describe.

      With Groups you must have a user account on the site and the user must belong to the related group to get access to a protected page. You can see more details on it here http://docs.itthinx.com/document/groups/access-control/

      WordPress’ password protection is described here https://codex.wordpress.org/Using_Password_Protection

      Cheers

  25. Vincent H December 11, 2018 at 3:07 pm #

    Hello,

    I just created a new capacity but I do not see how it has been granted rights, for example the permission to put a category. Can you help me ?

    thank you

    • Kento December 17, 2018 at 1:42 pm #

      Hi Vincent,

      I think what comes closest to what you are looking for is the existing capability manage_categories. If you add this capability to a group, the group members will have it.

      Cheers

  26. Humberto Oceguera December 8, 2018 at 1:28 am #

    Hello guys, I’m having a little problem with the groups plugin and I hope you can help.

    I have a subscription service where Macro Watch Subscribers can access this (Macro Watch) video class and it works just as expected… but when I made a list by taxonomy or term to display all videos by quarter (first quarter 2018) it display the titles of every video only if you’re a Macro Watch subscriber but even with the an statement to filter the way users access this list I can’t find a way to display the list to non registered users.

    Is there a way to do this?

    I’m attaching a Gist link to the code I’m using: https://gist.github.com/humbertopr/754e39c51752c78aeb0354f349da3102

    • Kento December 9, 2018 at 12:27 am #

      Hi Humberto,

      You would want to disable the posts_where filter of the Groups_Post_Access class while you attend to this request. Remember to reinstate them once you’re done. Alternatively you could pull the info from the database directly.

      remove_filter( 'posts_where', array( 'Groups_Post_Access', 'posts_where' ) );
      // get the posts and render the titles ...
      add_filter( 'posts_where', array( 'Groups_Post_Access', 'posts_where' ), 10, 2 );

      Cheers

      • Humberto December 10, 2018 at 8:00 pm #

        I think that did it!…

        Thanks for the fast response 🙂

        • Kento December 10, 2018 at 8:43 pm #

          Great to hear that! 🙂

          • Humberto May 26, 2019 at 12:34 am #

            Hey Kento, sorry to bother you again but after updating Woo and the plugins the stopped working on the website and I’m not sure why.

            Did something change? can you take a look at the code end let me know what I need to change?
            The filter is removed on line 28 and activated again on line 95

            CODE: https://github.com/MrHOG/Demos/blob/master/page-videos.php

            Thanks for the response in advanced.

            • Kento May 29, 2019 at 10:22 am #

              Hi Humberto, this looks ok to me 🙂

          • Humberto May 26, 2019 at 12:37 am #

            Forgot to include the link where the list items are not showing anymore:
            https://richardduncaneconomics.com/videos/

            • Kento May 29, 2019 at 10:23 am #

              Thanks, this also seems to be working fine. You have the links to the protected posts while the posts themselves are protected.

  27. Nicolás November 27, 2018 at 1:02 pm #

    Hi, I was wondering, is there a way to make the posts that don’t have a group selected to be hidden from everyone (except users with administrator capabilities and such) until a Group is selected?

    The plugin is awesome, been using it for a while!

    • Kento November 27, 2018 at 4:10 pm #

      Many thanks Nicolás, great to hear that!

      With Groups you would have to assign a group to the posts, otherwise it couldn’t be restricted. You could use a dedicated group for this purpose. As an example, when I am working on a documentation page that I don’t want to be visible yet until it’s finished, I assign it to a group named WIP so our team knows it’s work in progress. When the page is finished I remove the assigned group – that way you can publish the page without the public being able to see it. In your case, you would remove the special group and assign the group you want to be able to see it.

      Cheers

      • Nicolás November 27, 2018 at 5:50 pm #

        Excellent I’ll do that !

        Thanks a lot for the quick reply

        =D

  28. Chris Norris November 22, 2018 at 4:27 am #

    I am wondering if its possible to add fields to the admin / group edit screen? If so, how can this be done, in a way that wont get overriden with an update.

    • Kento November 22, 2018 at 8:59 am #

      Hi Chris,

      That’s an interesting question. Groups itself does not provide customizable fields currently, but this is certainly open for suggestions. I suppose you want to attach customized information by group, is that correct? If yes, it could be good to add metadata to groups which people could use easily (similar to postmeta).

      Cheers

  29. sachiese November 15, 2018 at 1:29 am #

    Thank you for the quick reply! I’ll look into those add-ons.

    Looking forward to the future updates!

  30. sachiese November 13, 2018 at 12:14 pm #

    I love your detailed group features but I’m a bit disappointed that we have to use WP default user profile page for subscribers. Do you have any add-ons or features to create custom profile page?

  31. Sally Law November 8, 2018 at 9:07 am #

    Hi I need advice. I am looking to create a site that is a magazine/ blog that showcases different artists work. I want the reader to be able to buy the product from the artist/ designer directly. By clicking on a link or image or so on. I would like this to take them to a place of sale. This means I want the artist( seller) to be able to create their own page or ‘section’ of the site. They need to be able to manage the inventory and send the goods and so on. I just want a percent for facilitating the sale. I thought to create a multisite network and get artists to create their own ‘shop’ within the net work. However I am wondering if there is a simpler way? It’s also possible that the seller(artist) will already have a website and won’t want to have to manage two. So perhaps Affilate links will be what I need. Any advice or direction as to how to go about even one of these concepts would be appreciated.

    Thank you

    • Kento November 10, 2018 at 10:39 am #

      Hi Sally,

      Besides what I replied to you earlier in response to your email, as I just get to read your comment here I wanted to point you to some additional resources. I’m not sure what connection to Groups we can draw to this but I would recommend to also have a look at the Product Vendors extension for WooCommerce, alternatively Affiliates Products and certainly at WooCommerce Product Search which will be useful to find products in any case.

      Cheers

  32. Jason November 5, 2018 at 12:27 am #

    I am trying to find a way to “modify” the groups_member shortcode but i cannot seem to get it to work.

    What i want is to be able to add some extra content to the shortcode so that when its being used its not just cutting off the content but rather cutting it off and adding an “unlock” icon and some text.

    we implemented the plugin on an onine digital subscription site, so we have a teaser of content and then the groups plugin locks down the rest of it. We currently have edited the plugin directly to add an else{ do some stuff like add an icon and link and some text} to the end of the shortcode function, but I really would like to add this code to the child theme in order to save the hassle of editing the plugin directly every time.

    remove_shortcode and add_shortcode don’t seem to work in this instance either… any help is much appreciated.

    • Kento November 10, 2018 at 10:22 am #

      Hi Jason,

      I can recommend to have a look at this implementation of a version of the shortcode https://github.com/itthinx/groups-cmember – it’s a plugin off which you can easily derive your version without the need to hack Groups itself. Just make sure to give the shortcode a unique variation name so it doesn’t conflict with the original one.

      Cheers

      • Jason November 15, 2018 at 6:33 pm #

        The issue is that we have 1000’s of posts using the standard shortcode… so i would have to go back and change all of them instead of just requesting that the wordpress developer use filters in their plugins…

        • Kento November 16, 2018 at 4:12 pm #

          A filter could be a good idea but it’s very easy to change the shortcode used for you with a simple SQL query replacing matches of “[groups_member” with “[your_shortcode”. Even if we were going to add a filter, if you are using a version that is specific to your site, a custom shortcode might be simpler to handle and would be more intuitive. As you initially mentioned that you are trying to modify the shortcode which I can’t recommend, using the replacement and a custom version is a more straight-forward and quicker option.

          • Jason November 16, 2018 at 4:45 pm #

            I am not trying to “modify” a shortcode. I am trying to “extend” its functionality.

            Something that is pretty much standard practice for plugin creation in wordpress, is the creation of extensible plugins (or at least its highly recommended and rarely done ).

            I can very easily create my own shortcode to perform what i need done(i have) and then search and replace my database to use that shortcode instead of the one in your plugin(debating if its worth it), but at that point i can also just create the lock feature in that shortcode and remove your plugin.(if that’s all that it is offering)

            My comment was more to recommend that as a plugin creator, using extensible plugins and filters for creating the plugins, would make your plugin much more useful to the masses.

            Hey our plugin cuts off the content you don’t want people to see, or hey our plugin cuts off the content, and here is an example of a filter you can use to add a lock icon, a link to request more information, etc all from our great plugin.. are two very different things.

            At that point you open your plugin to the masses that also create custom implementations of things that you may not have thought of when you created your plugin. They whip up a small plugin themselves that extends yours and bam, now you have a whole new community of people using it. I mean a perfect example is woocommerce. By itself its an ok plugin… but since its extensible, there are literally 1000s of implementations using add on plugins to tweak its features.

            Anyways, Thank you for the recommendation, and hopefully none of this comes off as rude, I am simply offering an opinion on a feature that would be very useful to many of the sites we build.

            • Kento November 22, 2018 at 9:36 am #

              Hi Jason,

              Thanks for your reply and the suggestions. Don’t worry, I really appreciate it that you have taken the time to explain your points.

              Actually Groups is designed with extension in mind, and among the thousands of installations there are many that are doing exactly that. If you check out the API section of the documentation http://docs.itthinx.com/document/groups/ you will see that there are actions and filters provided. I am sure that we can have more filters, such as to cover the case you have suggested.

              For this particular case I think it would just be quicker and more efficient for you to have the customized shortcode – based on the initial question, it seemed that you were looking for a way to modify the Groups core code itself which I was trying to suggest to avoid.

              I will add the suggested filter to our todo list, in case you would like to suggest an implementation please feel free to fork and open a pull request with the suggested filter added: https://github.com/itthinx/groups/

              Cheers

  33. Louis October 29, 2018 at 6:17 pm #

    Very good plugin that we use extensively, but we have made a minor tweak to improve functionality. We are using the groups_group_info shortcode, which displays all user’s userids in specified group, we are modifying line 189 of file /groups/lib/views/class-groups-shortcodes.php changing “user_login” to “display_name” after each update so user’s display names are shown. It would be nice if one of the options included the choice of which to display.

    Thanks.

    • Kento November 10, 2018 at 10:42 am #

      Hi Louis,

      Instead of modifying Groups’ code itself it’s much easier to simply derive your own version of the shortcode by implementing it within a small plugin. Create a version which differs in name though in order to avoid a clash with the original one. You can find an example here for one of the shortcodes: https://github.com/itthinx/groups-cmember

      Cheers

  34. Sveta October 21, 2018 at 10:03 am #

    Hello, Kento!

    Thank you for this plugin – it’s working very well 🙂 But last 1-2 month about 30% of users do not have access to closed pages – there are no restrictions for them.

    Could you help what could be the problem? Maybe some plugin interferes?

    • Kento October 25, 2018 at 9:59 pm #

      Hi Sveta,

      I have seen some cases where a group was deleted and the access restrictions were not removed (for a variety of reasons or conflicts). What you can try very easily is edit a page where this happens, assign a group to restrict access, save the page, then remove the group restricting access and save the page again. This will reset any internal assignments that might be mixed up.

      Cheers

  35. Alexis October 18, 2018 at 7:22 am #

    Heloo,
    you plugins seems to be realy powerfull.
    I’m looking for a solution so that users can themself suscribe to groups via forms.
    I’m doing a teaching site and looking to create some kind of path. When they give the right respond (some kind of test) they access automaticly to the second groups. Stuff like this.
    Is there an api call that i can put in my forms that suscribe a user to the next level. I ‘m sure it’s possible (loked to the api) but did not understand realy how to do it. (not pro in coding!)
    can you put me on track ?
    Thanks a lot for this beautyfull peace of code
    (an sorry for my non native english language!)
    ALexis

    • Kento October 25, 2018 at 9:49 pm #

      Hi Alexis,

      Many thanks on your kind feedback on the plugin!

      To assign a user to a group is very easy, you can find an example on top of this documentation page: http://docs.itthinx.com/document/groups/api/examples/

      There is also an example on how to obtain the group by name a bit further below on the page, you can use that to obtain the group ID used to assign the user to a group.

      I hope this helps you!

      Cheers

  36. Tom October 4, 2018 at 8:02 pm #

    Hi. How do I make the page accessible to the public when the pages are using Groups? It just says that it can’t find the page if you are not logged in. Thanks.

    • Kento October 12, 2018 at 5:21 am #

      Hi Tom,

      If a page is restricted to a certain group, it will not be accessible to the general public, this is by design – I would recommend to have a look at the documentation pages to understand how Groups’ Access Control works: http://docs.itthinx.com/document/groups/access-control/

      Cheers

      • Victor W16 January 31, 2019 at 5:11 pm #

        I’m using Groups mostly for admin access filtering.

        This will disable groups check for not logged in users:

        function test_groups($result, $user, $capability){

        // Check not logged in
        if ($user->ID == 0){
        $result = true;
        }

        return $result;

        }
        add_filter( ‘groups_user_can’, ‘test_groups’, 10, 3 );

  37. Yannick October 2, 2018 at 11:33 pm #

    Thanks for this great plugin
    In WP 4.9.8, we can find in Options nav_menu_item as a post type you can check.

    But once checked, I can’t see the “group” input into my menu items
    How can i restrict menu items to certain groups of users ?

    • Kento October 10, 2018 at 5:45 am #

      Hi Yannick,

      Nice to hear that you like it!

      Although you can find the nav_menu_item entry under the post types listed, it will not provide an additional option for those to restrict access. Where it’s not a custom link (fixed URL), the access restriction will determine whether the link is displayed or not based on the user viewing the site.

      Cheers

  38. Wilhelm September 25, 2018 at 12:06 pm #

    Hi

    Is it possible to use this plugin to counts the terms of a custom taxonomy made by the group. could you please advise on a way to do this.

    Here is a link to the same qestion on the wordpress plugin support page plus the code I use to count the raw post with out groups.

    https://wordpress.org/support/topic/use-the-groups-plugin-2-counts-a-custom-taxonomies-terms-per-group/

    • Kento October 12, 2018 at 5:46 am #

      Hi Wilhelm,

      On https://codex.wordpress.org/Class_Reference/WP_Query you will find examples of a meta_query added to the query, in the particular case you are asking about, you would use the meta_key = 'groups-read' and meta_value = $group_id with meta_compare = '=' … obviously $group_id would hold the ID of the relevant group; you would use ‘IN’ as the comparison for multiple groups.

      Cheers

  39. René September 17, 2018 at 11:32 am #

    On the Group Options page, there seems to be a possibility to include nav_menu_item (ie. menu items). However, when checked, under Appearance > Menus > Menu …, there is no option to select specific groups that should see a menu item … Is this a bug, or simply wishful thinking? I hoped it would work like the ‘User Menus’ plugin, which allows for each menu item to select specific roles that should see that item – including custom links (see https://nl.wordpress.org/plugins/user-menus/)

    I am really having trouble finding a one-stop solution that enables me to show / hide any type of information on my site (ie. media, pages, posts, custom post types, widgets, menus) based on a specific group. The Groups plugin seems unable to limit access to menu items based on groups, the AAM plugin has a similar problem (based on roles). An alternative solution would be to skip groups, create user roles instead of groups, and use the Members plugin by ThemeHybrid to determine which content is shown to who. The ‘User Menus’ plugin could then be used to show or hide menu items. But I would prefer to keep groups and roles separate.

    Please let me know if you know a solution around this.

    • Kento September 19, 2018 at 7:30 pm #

      Hi René,

      For menu items that are directly related to a post type like those you choose from Appearance > Widgets under Posts or Pages, the items will be hidden if the entry is protected itself. If you use Custom Links, the menu items will appear always.

      It’s not related to the Navigation Menu Item / nav_menu_item you see under Groups > Options, at least not yet, although this is something I’d like to have added to Groups.

      I hope this helps to understand how these are currently handled and thanks for asking about it.

      Cheers

      • René September 20, 2018 at 1:15 pm #

        Hi Kento, thanks for clarifying this! It would be great if in the future, Groups could also handle Custom links in menu’s, making it a really alround solution. Keep up the good work!

        • Kento October 12, 2018 at 5:58 am #

          Hi René,

          I agree, we should have this and it’s already on my todo list 🙂

          Cheers

  40. Giant August 22, 2018 at 12:38 pm #

    Hi

    I want to know whether users can create group and invite user in his group

    Regards

    • Kento August 22, 2018 at 5:31 pm #

      Hi,

      Thanks for asking, currently not but good to know there’s interest for group invites so I will take it into account for enhancements.

      Cheers

  41. Wilhelm August 16, 2018 at 4:40 pm #

    hi support.

    I like to know whether I am implementing the Shortcode correctly.

    I am setting a variable with get_template_part to recall the loop if the logged in user is part of the group.

    see the code below.

    The problem right now is that the loop is being recalled for all users and not just uses belonging to the group.

    • Kento August 22, 2018 at 7:50 am #

      Hi Wilhelm,

      The code was automatically removed from your comment – can you please provide it via a Gist?

      Cheers

Leave a Reply to Anthony Randall Click here to cancel 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