BP_Blogs_Blog::delete_blogs_for_user( int|null $user_id = null )

Delete all of a user’s blog associations in the BP tables.


Parameters Parameters

$user_id

(int|null) (Optional) The ID of the user whose blog associations are being deleted. If absent, defaults to logged-in user ID.

Default value: null


Top ↑

Return Return

(int|bool) Number of rows deleted on success, false on failure.


Source Source

File: bp-blogs/classes/class-bp-blogs-blog.php

	public static function delete_blogs_for_user( $user_id = null ) {
		global $wpdb;

		if ( !$user_id )
			$user_id = bp_loggedin_user_id();

		$bp = buddypress();

		return $wpdb->query( $wpdb->prepare( "DELETE FROM {$bp->blogs->table_name} WHERE user_id = %d", $user_id ) );
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.