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.


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.


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.


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


  • 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 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!


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


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.


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.


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:


Here you can:

  • add groups
  • remove groups
  • assign capabilities to groups


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.


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.


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


Download the Groups plugin on WordPress.

1,927 Responses to Groups

  1. Suman kalyan mohanty February 1, 2016 at 9:05 am #

    Hi Antonio

    I m just using this plugin and it’s working good.
    All the users are automatically added to registered group by default.I want users to be added to my own created groups(eg:VETS,a group I created).
    Please let me know how to do that?
    Hope for a quick heads up.


    • antonio February 1, 2016 at 9:39 am #

      Hi Suman,
      you can use this code in your functions.php theme file. You need to change ‘Premium’ for your group’s name.
      Kind Regards,
      Antonio B.

      • Suman kalyan mohanty February 1, 2016 at 10:37 am #

        Hi again

        It’s working good after putting that code in functions.php.But now users are added to both registered and the group I created i.e vets, at the same time. How can I added the users to only “vets” group.

        I dont users to be added to registered groups.Please let me know as this is my client’s requirement.


  2. Suman kalyan mohanty February 1, 2016 at 10:07 am #

    Hi again

    It’s working good after putting that code in functions.php.But now users are added to both registered and the group I created i.e vets, at the same time. How can I added the users to only “vets” group.

    I dont users to be added to registered groups.Please let me know as thisi s my client’s requirement.


    • antonio February 1, 2016 at 10:42 am #

      Hi Suman,
      ‘Registered’ is the default group, it can not be removed. But it should not be a problem, simply limit your contents to the VET group.
      Kind Regards,
      Antonio B.

      • Suman kalyan mohanty February 1, 2016 at 10:53 am #

        Thanks a lot for the heads up 🙂

  3. Aj February 4, 2016 at 12:27 am #

    I have been using the Groups plugin for around a year and it has worked great. Today I tried something that seemed very straightforward, but it is not working as expected.

    My problem involves two groups.

    GM Group
    – groups_read_post
    – access_all_shops

    Owner Group
    – groups_read_post
    – access_all_shops
    – access_shop_owners

    The WP users in question are assigned to either the ‘GM’ or ‘Owner’ group.

    I created a post that I gave an access restriction of ‘access_all_shops’.

    Inside that post I have several download link shortcodes (from WordPress Download Manager Pro). For one of these shortcode links I have added the Groups shortcode access restriction of ‘access_shop_owners’. It looks like this…

    [groups_member group="access_shop_owners"][wpdm_package id=’1060′][/groups_member]

    Expected Behavior
    The post would be accessible only to ‘Shop’ users but the one download link would only be seen by the ‘Shop Owners’.

    Actual Behavior
    The post is accessible only to ‘Shop’ users, but the one download link is hidden to everyone?

    What do I need to do to achieve the ‘Expected Behavior’? Thank you for your help.

  4. Aj February 4, 2016 at 12:41 am #

    I just solved my own question. It was a silly mistake with a simple answer. I was using the name of the ‘capability’ in the Groups shortcode instead of the name of the ‘group’ itself. Once I made that change, everything worked as expected.

    Thanks for a great plugin!

    • antonio February 4, 2016 at 8:10 am #

      Perfect 😉
      Kind Regards,
      Antonio B.

  5. Jerry Christensen February 4, 2016 at 4:47 pm #

    When a Woocommerce subscriber cancels their membership they are removed from all groups. How do I set it so they will automatically be placed in the Registered group upon cancellation?

    • antonio February 4, 2016 at 9:16 pm #

      Hi Jerry,
      by default new users are in ‘Registered’ group, so you don’t need to select the ‘Registered’ group in your subscriptions.
      Kind Regards,
      Antonio B.

      • Jerry Christensen February 4, 2016 at 9:29 pm #

        I thought that was the case as well however it was brought to my attention today that when a subscription is canceled the member is removed from all groups and they cannot see anything within the [groups_member group="Registered"]…[/groups_member] shortcode until I manually put them back in the Registered group. I also noticed that they are automatically assigned to the Registered group if I deactivate and reactivate the groups plugin. My question is, “Is there a way to make assignment to Registered group upon downgrade automatic without having to deactivate and reactivate the plugin?” Thanks so much for everything. I think your work is pretty amazing!

        • antonio February 5, 2016 at 9:03 am #

          Hi Jerry,
          what subscription plugin are you using ? Woocommerce Susbcription? So I can test this (If you want, you can send me dashboard admin access to antonio at itthinx dot com indicating this comment, and I’ll have a look at your settings).
          Kind Regards,
          Antonio B.

  6. Joffreu February 15, 2016 at 3:36 pm #

    Is it possible to restrict the edition and creation of article, of a certain cartegory to a certain group of admin ?

    I see how to restrict categories to users, but I’d like do to the same with administrators.

    • Kento February 15, 2016 at 7:33 pm #


      You can protect the category – if the user who is publishing the post doesn’t belong to a group that has access to the category, then it won’t be available to that user. Does that work for what you have in mind?


  7. Sophie Jones February 15, 2016 at 10:09 pm #

    Is there any way to allow a user to manage one group, in a sense be the owner of that group and allow him to add sub-groups to his group if necessary without giving them major global permissions??
    Basically, I would like to be able to create the parent group for privileged role users and give them owner of the group and allow them to create subgroups in this group??
    My goal is to create a page using group shortcode and show list of users in this group with a custom field in their profile to show if they are available or not. So the owner/manager of this group can see, and add a button to open a form to create subgroup where he can add from users who are available and create his subgroup which he can later use on a custom post type.

    • Kento February 18, 2016 at 4:11 pm #


      Thanks for asking – it’s possible to create a group with administrative permissions for the Groups section itself, but it wouldn’t be possible yet to limit these to allow only subgroups to be managed by someone. We’re working on a more fine-grained permission model but it isn’t available yet.


  8. Karl February 17, 2016 at 4:13 am #


    I’m looking for a way (possible a small snippet added to my theme’s functions.php file) that would allow me to redirect a particular link or page to another url/page on my site based on the logged in user’s group or capability. More specifically, I’m looking to redirect a generic URL (call it https://mysite/dashboard) to one of several other urls based on a user’s assigned group.

    Any ideas?

    Note that I’m NOT just trying to redirect after login. I’m trying to systematically redirect a particular link…

    Thanks in advance!

    • Kento February 18, 2016 at 4:22 pm #

      Hi Karl,

      I would probably go about this in a similar way as used by Groups 404 Redirect – hooked on the wp action and using the Groups API to check to which group a user belongs (see Examples). Does that help?


  9. Elia February 17, 2016 at 6:11 am #


    I use Groups to grouping my authors and I found an editor for any group.
    Now I want to add group filter to posts page to filter the posts by group.
    Is there a way for this issue?!

    Thank you

    • Kento February 18, 2016 at 4:04 pm #


      Thanks for the suggestion, currently there is not filter to show posts by authors’ group membership but it sounds like a useful idea. Maybe we can add this later on.


  10. Andrei G. February 25, 2016 at 4:20 pm #


    I have a site where there are many groups and subgroups and inherited capabilities. I am able to restrict access to pages or posts to a certain group or subgroup just fine.

    My question is how would I go about excluding access to a page or post for a specific group without having to list all the others that do have access?


    • Kento March 1, 2016 at 7:20 pm #

      Hi Andrei,

      That’s a good question – in fact there are plans to add the possibility to exclude certain groups from being able to access a page, but currently it won’t be possible … maybe using the [groups_non_member] shortcode is a solution meanwhile? You can use it to enclose content on a page so that it is hidden from group members. If the page itself it protected, then that could work. Also note that you would have to combine it with the [groups_member] shortcode enclosing that section so that those who shouldn’t have access can’t see it either (if the page isn’t restricted).


  11. Brian Russell March 2, 2016 at 3:50 pm #

    Is there any way to get a multisite install to recognize group affiliation across the multisites? If I wanted a specific group to have access to that group’s access across the whole network?

    That would be incredibly helpful.

    • Kento March 16, 2016 at 12:30 pm #

      Hi Brian,

      Thanks for asking, this isn’t possible yet altough we’re already aware of the usefulness and should be providing a solution hopefully soon. See this topic for example.


  12. Juliette March 6, 2016 at 3:35 pm #

    Hi Itthinx team,

    Do you sell plugin’s group which allows to hide or to show different menus according to the group of the users ?


    • antonio March 7, 2016 at 5:34 am #

      Hi Juliette,
      you have available this plugin that you must customize it.
      Kind Regards,
      Antonio B.

      • Juliette March 7, 2016 at 8:41 pm #

        Hi Antonio,

        I’m talking about premium plugin that I can buy to you… :))

        But If you have a free plan…
        How can you do to install this file ? You install it in folder in /plugins/ ?

        Sorry I’m not developper… :oS

        • antonio March 8, 2016 at 8:52 am #

          Hi Juliette,
          maybe this solution is easier for you, please have a look at this conversation.
          Kind Regards,
          Antonio B.

  13. Keith March 10, 2016 at 11:26 am #


    I am looking to see if the Groups membership plugin would allow me to do the following:

    Example: John Smith (member) logins into the site, and he can only see posts that have been assigned to him. No one else would see this posts.

    Would I need other extensions or custom coding to do that?


    • Kento March 10, 2016 at 6:04 pm #

      Hi Keith,

      With Groups you can grant access to members of a certain group, so in this case, you would protect the pages and then assign John Smith to the group that has access. See Access Control in the documentation for details please.


  14. Web March 16, 2016 at 2:31 am #

    We have Group Plugin on the website and we have around 1000 groups live for Access restrictions.

    The issue is when we have Groups plugin active with 1000 Groups, we are not able to load the images under the Add Media window quickly.

    Is anyone have idea how can we fix this issue????

    • Kento March 16, 2016 at 1:43 pm #


      I don’t see where this would affect the Media > Add New screen, the access restrictions aren’t even listed there so I’d like to find out why this is creating an issue for you on your site. Do you get any Javascript errors?


  15. Sam March 20, 2016 at 6:02 pm #

    Hi – i cant find a way to lists the users in a particluar group, on the front-end?

    • antonio March 21, 2016 at 3:22 pm #

      Hi Sam,
      you can use this plugin and use the [groups_users_list_group] new shortcode, with the ‘group_id’ attribute.
      Kind Regards,
      Antonio B.

  16. JoC March 31, 2016 at 1:48 am #

    I need access-protected posts to be visible on category pages (or any page that uses the $wp_query variable).

    I found the relevant code in the plugin directory /groups/lib/access/class-groups-post.access.php, in the function posts_where (there is a mySQL statement that pulls posts which aren’t protected or which the user doesn’t have the capability to access.

    Instead, I want all the posts to be visible, but if a user clicks on them, I want the posts to remain access protected.

    What adjustments can I make to the posts_where function, in order to accomplish this?

    • antonio April 4, 2016 at 8:55 am #

      Hi JoC,
      maybe Groups Excerpts can be a solution.
      Kind Regards,
      Antonio B.

  17. Desheen L. Evans April 7, 2016 at 7:12 pm #

    I have the plugin installed and set-up nicely, but I want to protect the page behind a payment wall and only allow visitors to sign up for a membership then they can access.

    Can someone help me by going into my WP dashboard?

    • antonio April 8, 2016 at 9:37 am #

      If you are using Woocommerce, you can use Groups Woocommerce to sell access to groups. So only users who purchase “this product” have access to the protected pages.
      Kind Regards,
      Antonio B.

  18. Marcus April 14, 2016 at 1:57 pm #

    Your plugin says that it can restrict access to custom types of media. For instance the access restrictions option comes up in my media library, if I apply a restriction to the media I find that it does not work. If i type the web address into a browser of which I am not logged into my site I go directly to that document. What I really would love is a way to completely lock down media/files using groups. Any help you can provide is appreciated.

    • Kento April 14, 2016 at 3:20 pm #

      Hi Marcus,

      That’s correct, the attachment page itself is protected but if you have the direct URL to the file it will still be accessible. You can protect files using Groups File Access, please have a look also at the documentation so you can see if that would be suitable for your requirements.


  19. Maxident April 22, 2016 at 11:11 am #

    Hi Kento,

    I am thinking about buying the groups file access plugin. As far as I understand file restriction works based on the group membership only. Is there a way to add a password request before the file can be downloaded if the member is part of a group that is linked to the file?

    I am not sure if membership alone is enough security.


    • Kento April 22, 2016 at 1:12 pm #


      The user has to be logged in to access the file or use a specific link, otherwise it will not be accessible. There’s no additional password option to access the file, it’s not something that I would consider adding as I consider the plugin’s restriction already sufficient, but thanks for asking.


  20. Eric April 26, 2016 at 1:10 am #

    First off, fantastic plugin! Groups has really been helpful, so thank you!

    But I seem to have a strange issue. I’m using Groups to show/hide posts based on membership. However, if I make a post sticky, it shows up on the posts page even though the user doesn’t belong to that group. If you try clicking into the post, you get a 404, which is good. But I need to stop a sticky post from being listed on the posts page.

    Is marking a post sticky supposed to override Groups or am I just missing something here?


    • antonio April 26, 2016 at 8:55 am #

      Hi Eric,
      Sticky posts override Groups, but you can use this code if you need to filter the sticky posts.
      Kind Regards,
      Antonio B.

  21. Martijn April 28, 2016 at 2:22 pm #


    We want to use groups to limit access to several pages/content.
    But there is one thing we want to do, were we don’t see any options for, so I don’t know if it can be done with this plugin or with any of the addons. So maybe someone here can help us out.

    For a couple of the groups we would like to have a specific group page, were some info for this group is displayed. Users can be in multiple groups.

    Is there a way to only display the pages the user has access too in a menu, preferably in the submenu.
    exaple : User X is part of group A,C & G
    So user X sees:
    -group a
    -group c
    -group g

    & user Y is part of group D & G and sees
    -group d
    -group g

    I hope its clear what we would want.
    Is this possible within this plugin and or its addons? or do we have to find another solution.

    Kind regards,


    • Kento May 1, 2016 at 9:13 am #

      Hi Martijn,

      If you add a restricted page to a menu through Appearance > Menu > Pages the menu item will only show up if the user has access. This works with protected posts, too, note that it will have no effect if you add a URL directly using Custom Links.


      • Martijn May 2, 2016 at 8:02 pm #

        Thanks, works like a charm.

      • Cloudfusion May 19, 2016 at 9:05 am #

        Hi, I have custom links in my menu used as seperators, how can I hide these links using Groups? or Is there any other solution / idea to implement this to work with Groups? Thanx!

        • antonio May 23, 2016 at 7:43 am #

          Hi Cloudfusion,
          you can use the Menu Item Visibility Control plugin using this code: current_user_can(‘your_capability’);
          Antonio B.

  22. Loic May 2, 2016 at 4:50 pm #

    Hi !

    Is it possible to not hide a menu when the user doesn’t have the correct permission ? Just display a message on the page like “Sorry, you do not have the correct permission”.

    Thanks 🙂

    • antonio May 3, 2016 at 5:50 am #

      Hi Loic,
      You can do it using shortcodes in the page/post content, instead of limit the full page/post.
      Kind Regards,
      Antonio B.

  23. Martijn May 2, 2016 at 8:05 pm #

    Can this plugin also be used to limit the pages that are editable by a group ?

    case: a couple of user filled pages, were a couple of blogs and events are automaticly placed, but the group “owner/leader” should be able to edit this page. But he/she has no business editing any of the other pages. Can I use this plugin to make an editor, who is part of group A, only able to edit the page of group A?

    Kind regards,


    • antonio May 5, 2016 at 6:48 am #

      Hi Martijn,
      If you restrict a post/page to a groupA, and your editor user is not in this group, then he can not view/edit this page/post.
      So you could restrict all your pages to a ‘editorGroup’. Create an ‘ownerLeaderGroup’ and assign the pages editable to this ownerLeaderGroup.
      If you need to have editors who can edit all pages, the join these editors to both groups: editorGroup and ownerLeaderGroup.
      Kind Regards,
      Antonio B.

  24. Facemweb May 4, 2016 at 12:39 pm #


    Is it possible to remove all the users of a group instead of making it user by user ?

    • antonio May 4, 2016 at 1:52 pm #

      Hi Facemweb,
      From the Users->All users page you can select multiple users and uses the bulk actions.
      Kind Regards,
      Antonio B.

      • Facemweb May 6, 2016 at 7:32 am #

        Didn’t see that option !!
        Thanks !

  25. John King May 19, 2016 at 4:22 pm #

    Hi, I have applied the Access Restrictions to the Media post type in Groups / Options.

    When I go to a page and click ‘Add Media’, then drag an image to the screen the Access Restrictions dropdown seems to be broken and in my console I see the error message ‘Uncaught TypeError: jQuery(…).selectize is not a function’.

    Is this a known bug? And is there a fix I can apply?


    • antonio May 20, 2016 at 5:40 am #

      Hi John,
      I can not replicate your issue. Please be sure you have the latest versions and check if you have another plugin that could have javascript problem.
      If the problem persists, you can send me dashboard admin access to antonio at itthinx dot com, indicating this conversation and I’ll have a look at your settings.
      Kind Regards,
      Antonio B.

  26. Dave May 24, 2016 at 7:23 pm #

    I have been considering this plugin for membership access to a client’s website (along with the paypal, forums and file access modules). But the problem is that they would need a group subscription based on the groups instead of the users. For example, an organisation registers, and then their employees get access through the organisation. That would technically work with the groups, but for my client some automation would be required. When an organisation registers they would need to be able to pay to increase privileges to their group, which would then grant these privileges to their members. Technically, this already works with groups, but would require a lot of manual work by the site admin (create a group for the new organisation, collect payment, then add privileges to the group, then manually assign users to the group). I’ve been testing the plugin, but it can’t seem to do this. Is there any way to do some of this automatisation that I’ve missed? Any suggestions?


    • antonio May 25, 2016 at 5:24 am #

      Hi Dave,
      You can use the Groups API to create your own solution. You could have your groups with basic capabilities,and when you receive a payment, then add extra capabilities to this group.
      Relating to “Import/export users to/from a group”, you can do it manually or using the Groups Import/Export plugin.
      Kind Regards,
      Antonio B.

      • Dave May 25, 2016 at 1:33 pm #

        Thanks for the answer, I will look into that. I’ll look into upgrading the groups capabilities according to the other groups members are part of, so if a user of the group buys access to the premium group, everyone in the group gets the same capabilities.

        Is it possible to have users that are part of a group be able to invite other users to the group? I guess it could be done with the API but its already possible I’d rather not have to code it. 🙂


        • antonio May 25, 2016 at 5:44 pm #

          Hi Dave,
          I have created the Groups Invitations plugin that you can use as reference to create your own solution.
          Kind Regards,
          Antonio B.

          • Dave May 26, 2016 at 4:04 pm #

            Great! I modified it to work only on groups starting with a specific string pattern and added some obfuscation to the URL so it is not too easy to change the group id (and thus join the other groups that user is part of) and it works very well for what my client needs.

            Now I’m on to code the automatic group capabilities assignments. This solution seems very good, and most importantly, cheap for my client, since I don’t have to spend days coding a custom solution or have them pay through the roof for other membership plugins that charge crazy monthly/yearly fees for plugins that are not very good or even customizable.

            Many thanks!

            • antonio May 27, 2016 at 4:51 am #

              Perfect 😉

          • Dave May 26, 2016 at 7:23 pm #

            Hi again,

            I tried working on upgrading groups capabilities like I stated earlier, but could not get ‘groups_created_user_group’ to trigger. To test that I installed this demo:, added the Premium and Foobar groups and it doesn’t work. The ‘groups_created_user_group’ action still doesn’t trigger.

            Any idea?


            • antonio May 27, 2016 at 4:57 am #

              Hi Dave,
              Maybe are you working with capabilities? Please have a look at the actions documentation page.
              Kind Regards,
              Antonio B.

              • Dave May 27, 2016 at 11:06 am #

                Yes, I’m working with capabilities, but I need to know when a user joins a group. The way I see it, when a user joins a premium group, I want to know, and I will propagate the capabilities to its other membership groups at this moment, which is why I’m working with the ‘groups_created_user_group’ action. But if you have a better idea, I’m all ears.


                • antonio May 28, 2016 at 8:32 am #

                  Hi Dave,
                  Maybe this plugin can be used as reference. It does something different, but you can see the use of hooks.
                  Kind Regards,
                  Antonio B.

  27. Dave May 30, 2016 at 1:30 pm #

    Hi Antonio,

    I have dug deeper into the code. Here’s what the error message is:

    Warning: Missing argument 2 for gpatf_groups_created_user_group() in /******/wp-content/plugins/groups-premium-add-to-foobar-master/groups-premium-add-to-foobar.php on line 38

    Line 38 is:

    function gpatf_groups_created_user_group( $user_id, $group_id ) {

    It seems the add_action call on line 36 needs to be told to expect two variables with two extra parameters: 10 and 2.

    add_action( ‘groups_created_user_group’, ‘gpatf_groups_created_user_group’, 10, 2 );

    When I do that, it works. You might want to update the demo. 😉


    • antonio May 31, 2016 at 5:40 am #

      Hi Dave,
      thanks for sharing.
      Kind Regards,
      Antonio B.

Leave a Reply