[Resolved] Preventing access to group based on groupmeta
-
Hi everyone,
I’m currently developing a BuddyPress plugin that adds moderation to groups creation. Like : a superadmin has to validate any group before it is accessible.
I implemented it using a groupmeta field, trying to be as little intrusive as possible (not sure it’s the best way, though). Most of the mechanism works (creation, moderation, notifications, groups list filtering) but now I’m facing the following problem.
How can I prevent a group from being displayed, based on a groupmeta value ? The goal is : when accessing a not-yet-validated group, users (except superadmins) should see a message “this group is awaiting moderation”, and not have any access to any group information or sub-page.
Filtering the groups list was OK by adding a filter on
groups_get_groups
, but for a single group how can it be achieved ?
It seems thatbp_group_is_visible()
cannot be filtered / hooked. Anyway, if it is invisible how is it possible to trigger a specific rendering (“awating moderation” message) ?
Adding a filter togroups_get_group
that returnsnull
if the group is awaiting moderation… well.. breaks everything 🙂I guess this responsibility could be assigned to the theme, but then what if the admin switches to an incompatible theme ? The whole moderation mechanism would become pointless…
Thanks a lot for any advice !
BuddyPress is a great software.Greetings,
Mathias
- The topic ‘[Resolved] Preventing access to group based on groupmeta’ is closed to new replies.