Skip to:
Content

BuddyPress.org

Changeset 683 for trunk/bp-blogs.php


Ignore:
Timestamp:
12/14/2008 07:49:11 PM (17 years ago)
Author:
apeatling
Message:

Added delete account option and fixed bugs with removing BuddyPress userdata when account is deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-blogs.php

    r671 r683  
    578578add_action( 'delete_comment', 'bp_blogs_remove_comment' );
    579579
    580 function bp_blogs_remove_data( $blog_id ) {
     580function bp_blogs_remove_data_for_blog( $blog_id ) {
    581581    /* If this is regular blog, delete all data for that blog. */
    582582    BP_Blogs_Blog::delete_blog_for_all( $blog_id );
     
    584584    BP_Blogs_Comment::delete_comments_for_blog( $blog_id );
    585585
    586     do_action( 'bp_blogs_remove_data', $blog_id );
    587 }
    588 add_action( 'delete_blog', 'bp_blogs_remove_data', 1 );
     586    do_action( 'bp_blogs_remove_data_for_blog', $blog_id );
     587}
     588add_action( 'delete_blog', 'bp_blogs_remove_data_for_blog', 1 );
    589589
    590590function bp_blogs_register_existing_content( $blog_id ) {
     
    779779}
    780780
     781function bp_blogs_remove_data( $user_id ) {
     782    /* If this is regular blog, delete all data for that blog. */
     783    BP_Blogs_Blog::delete_blogs_for_user( $user_id );
     784    BP_Blogs_Post::delete_posts_for_user( $user_id );       
     785    BP_Blogs_Comment::delete_comments_for_user( $user_id );
     786
     787    do_action( 'bp_blogs_remove_data', $user_id );
     788}
     789add_action( 'wpmu_delete_user', 'bp_blogs_remove_data', 1 );
     790add_action( 'delete_user', 'bp_blogs_remove_data', 1 );
     791
     792
    781793
    782794
Note: See TracChangeset for help on using the changeset viewer.