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
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.