bp_blogs_remove_data( int $user_id )

Remove all blog associations for a given user.

Description

Parameters

$user_id

(Required) ID whose blog data should be removed.

Return

(bool) Returns false on failure.

Source

File: bp-blogs/bp-blogs-functions.php

1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
function bp_blogs_remove_data( $user_id ) {
    if ( !is_multisite() )
        return false;
 
    /**
     * Fires before all blog associations are removed for a given user.
     *
     * @since BuddyPress 1.5.0
     *
     * @param int $user_id ID of the user whose blog associations are being removed.
     */
    do_action( 'bp_blogs_before_remove_data', $user_id );
 
    // If this is regular blog, delete all data for that blog.
    BP_Blogs_Blog::delete_blogs_for_user( $user_id );
 
    /**
     * Fires after all blog associations are removed for a given user.
     *
     * @since BuddyPress 1.0.0
     *
     * @param int $user_id ID of the user whose blog associations were removed.
     */
    do_action( 'bp_blogs_remove_data', $user_id );
}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.