Skip Navigation

[Resolved] Filtering by Membership Group

This support ticket is created 5 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1128343

I am trying to create a view that filters by the membership group, which is managed by the WordPress groups plugin:
https://wordpress.org/plugins/groups/

I want to filter by the group, and also display the groups in a staff list.

I have been searching the documentation, but my search terms are not explicit enough to come up with applicable discussions.

Is there a function that will give Toolset access to the WordPress groups plugin?

#1128878

Hello,

The Access plugin supports WordPress custom user role:
https://codex.wordpress.org/Roles_and_Capabilities#Roles

It does not support the "groups" plugin, there isn't such a plan for it.

I have tried the "groups" plugin in my localhost, it seems to be able to assign some specific Capabilities to the user group, there is similar feature within Access plugin, you can try this:
Dashboard-> Toolset-> Access control-> Custom role
click button "Enable advanced mode", then edit one of user role, there you can change the Capabilities for each user role.

#1131545

I don't use the groups for capabilities. Just identification, and we already have code on the website that uses this plugin and I would prefer to not rewrite it.

I simply want to be able to "see" the groups when using Toolset views.

Is there a way to do that so I can create my own views?

#1131549

As I mentioned above, there isn't such a built-in feature within Views plugin, you might consider custom codes, for example, if it is a post view, you can use filter hook wpv_filter_query to apply your custom function to view's query:

https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_query
When displaying a View listing posts, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_Query class.

If it is a user view, you can try filter hook wpv_filter_user_query
https://toolset.com/documentation/programmer-reference/views-filters/#wpv_filter_user_query
When displaying a View listing users, this filter is applied to the arguments being generated by the View settings before they are passed to the WP_User_Query class.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.