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