Skip to:

No “groups_before_delete_group” hook?

  • I’m writing a Google Docs plugin for BP Groups. It stores its one setting – specifically, the shared Google Docs folder ID that’s created for the BP group – in the groups metadata table. It works great when I need to access it for group creation, member joining and leaving hooks.

    However, I need to be able to delete this Google Docs folder during group delete, but the only hook I can find that is triggered during the delete step occurs *after* the group and all its metadata has already been deleted. Why is there no action that’s triggered immediately before the group is deleted? All that’s left for plugin implementors is the group ID at this point, which is hardly useful to me – everything else is already gone.

    I’m thinking the only way around this is to create a new table for this information, which seems a bit cumbersome and a lot more work than I’d like to do. The metadata approach seems ideal – if only I could access that data in time.

    Any thoughts?

Viewing 4 replies - 1 through 4 (of 4 total)
  • I am now learning that this isn’t the only BuddyPress delete hook that is placed in this way. I’d also like to hook into `groups_remove_data_for_user()`, but same deal – the action is triggered only *after* the user’s group membership data has occurred (and that’s the data I need access to for Google Docs). I’m going to have to hook into WP’s user delete actions instead, specifying a higher priority than BP, since they are triggered immediately before deletion, when the data I need is still available.

    A similar incident was noticed in WordPress core w.r.t. user deletion a few years ago, and I guess developers agreed to insert an additional hook: one prior to deletion – `delete_user`, and one following deletion – `deleted_user`. (Original bug reported here:

    Can the same additional delete hooks be added to BuddyPress?

    Sure. Make an enhancement ticket on; patches also welcome ;)



    Wow, thats really cool! @farmer paul

    Had a thread in the past trying to build interest for a Docs plugin and came by some new info on docs and others doing intergration. Was bout to revitalise my old thread but thought I post it here instead.






    @farmer_paul how is the plugin working? will you make it available any time soon?

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘No “groups_before_delete_group” hook?’ is closed to new replies.
Skip to toolbar