Skip to:
Content
Pages
Categories
Search
Top
Bottom

Hook for deleting topic

  • OK, so I have at last found a good way of cleaning up my db when deleting groups (http://buddypress.org/community/groups/how-to-and-troubleshooting/forum/topic/cleaning-up-db-after-deleting-group/). The function`groups_delete_group_forum_topic( $topic_id )` is the key to success in this case, and I therefore want to make the same call when you press the ‘Delete Topic’ link.

    In the case of deleting groups I solved the problem by rewriting the `groups_screen_group_admin_delete_group` hook, but there doesn’t seem to be an equivalent to this for the ‘Delete Topic’ link. The theme files call a function named `bp_the_topic_admin_links()` in bp-forums/pb-forums-template.php, which in turn calls `bp_forums_delete_topic()` in bp-forums/bp-forums-functions.php.

    I could of course go the long way and make a copy of the theme file, write a custom admin link-function that links to a custom delete topic-function. Or I could simple add my own code directly in the delete topic-function, making bp not upgradable, but that’s just not a solution for me. Therefore I kind of hoped that there would be some special hook for deleting topics that I have overlooked…

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Hook for deleting topic’ is closed to new replies.
Skip to toolbar