Opened 10 years ago
Last modified 10 years ago
#2708 new enhancement
Abstract the ability to create, edit, delete BP group forums
Reported by: | boonebgorges | Owned by: | |
---|---|---|---|
Milestone: | 2.7 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Extend - BuddyPress | Keywords: | |
Cc: |
Description
I've got a client project where I need to create and modify BP group forums programatically (such as with a one-button "clone group" tool). To make this work with bbPress, I've had to reproduce much the logic of BBP_Forums_Group_Extension::create_screen_save()
, new_forum()
, and toggle_group_forum()
in a standalone function.
It would be nice if this stuff were abstracted out so it could be reused more easily. toggle_group_forum()
and new_forum()
could be marked as static. And I think all the logic could be wrapped in another static method or a straightforward procedural function like bbp_create_bp_group_forum( $group_id )
or whatever.
Side note: Having this stuff broken out a bit more would also make it easier to write unit tests for it, though the mods that'd be necessary to your test suite to make it bootstrap BP are beyond the scope of this ticket.
Thanks Boone,
Sounds like for me at least a programming challange/learning exercise ;)
Moving to 2.7 to take a look and if anyone patches this before 2.6 is released feel free to move it into the 2.6 milestone.