bp_media_remove_all_user_data( int $user_id )

Completely remove a user’s media data.

Description

Parameters

$user_id

(Required) ID of the user whose media is being deleted.

Return

(bool)

Source

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

function bp_media_remove_all_user_data( $user_id = 0 ) {
	if ( empty( $user_id ) ) {
		return false;
	}

	// Clear the user's albums from the sitewide stream and clear their media tables.
	bp_album_delete( array( 'user_id' => $user_id ) );

	// Clear the user's media from the sitewide stream and clear their media tables.
	bp_media_delete( array( 'user_id' => $user_id ) );

	/**
	 * Fires after the removal of all of a user's media data.
	 *
	 * @since BuddyBoss 1.2.0
	 *
	 * @param int $user_id ID of the user being deleted.
	 */
	do_action( 'bp_media_remove_all_user_data', $user_id );
}

Changelog

Changelog
Version Description
BuddyBoss 1.2.0 Introduced.

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.