boonebgorges/buddypress-group-email-subscription — pull request #15 by r-a-y (2012-05-17 00:18:51+00:00)
Title: Better support for 3rd-party plugins

Hi gang,

This pull request addresses #11. See commit 2b001605.

For group forum posts, 3rd-party plugin devs will need to filter `groups_get_current_group()` to grab the correct group in their plugins. I've tested this with another plugin I'm working on that utilizes GES' group forum functionality and it works, though I had to stuff my group ID temporarily into a global variable to get my filter working.

This is one negative with moving from the `bp_activity_after_save` hook to the `bb_new_post` hook as the group ID is not passed.

It might be better to move from the `bb_new_post` hook to the `groups_new_forum_topic_post` and `groups_new_forum_topic` hooks since they both pass the group ID, but are fired a little later in the sequence. I think for now this pull request will work though until I have more time to try out this idea.

Let me know what you guys think!