Ticket #1150 (new enhancement)

Opened 11 months ago

Last modified 7 months ago

Hook to allow plugins to prevent group creation

Reported by: simonwheatley Owned by:
Priority: major Milestone: Future Release
Component: Keywords: groups needs-patch
Cc: cnorris23+wordpress@…

Description

I'm working on a site where we don't want to allow the creation of groups by everybody. Looking through the group creation functions it doesn't look possible to restrict the creation of groups through plugin currently, the hook-to-stop-group-creation.diff patch (attached) adds a hook to allow this to happen.

The restrict-group-creation.php plugin (attached) shows how a plugin might use this new hook, and some existing ones, to disallow group creation with a nice user message explaining why, remove the "create group" link, and post a message on the first step of the group creation form explaining to the user that they can't create a group. I did look into actually removing the form fields, but this didn't appear to be possible without further code additions, and the measures described above seemed sufficient.

Attachments

hook-to-stop-group-creation.diff Download (1.9 KB) - added by simonwheatley 11 months ago.
Patch to add a hook allowing plugins to restrict group creation
restrict-group-creation.php Download (1.4 KB) - added by simonwheatley 11 months ago.
Plugin showing how the new hook might be used in a plugin which stops group creation

Change History

Changed 11 months ago by simonwheatley

Patch to add a hook allowing plugins to restrict group creation

Changed 11 months ago by simonwheatley

Plugin showing how the new hook might be used in a plugin which stops group creation

Changed 10 months ago by Jason_JM

  • keywords needs-patch added; has-patch removed

Via IRC, Simon has agreed to re-write patch to allow the option for Admin to set whether a group can be created.

Changed 7 months ago by apeatling

  • milestone changed from 1.2 to Future Release

Changed 7 months ago by cnorris23

  • cc cnorris23+wordpress@… added
Note: See TracTickets for help on using tickets.