bp_remove_user_data_on_delete_user_hook( $component, int $user_id )

Determines whether user data should be removed on the ‘delete_user’ hook.


Description Description

WordPress’s ‘delete_user’ hook is ambiguous: on a standard installation, it means that a user account is being removed from the system, while on Multisite it simply means the user is being removed from a specific site (ie its roles are being revoked). As a rule, this means that BuddyPress should remove user data on the delete_user hook only on non-Multisite installations – only when the user account is being removed altogether. However, this behavior can be filtered in a global, per-user, or per-component fashion.


Top ↑

Parameters Parameters

$data_type

(string) (Required) Type of data to be removed.

$user_id

(int) (Required) ID of the user, as passed to 'delete_user'.


Top ↑

Return Return

(bool)


Source Source

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

function bp_remove_user_data_on_delete_user_hook( $component, $user_id ) {
	$remove = ! is_multisite();

	/**
	 * Filters whether to remove user data on the 'delete_user' hook.
	 *
	 * @param bool   $remove    Whether data should be removed.
	 * @param string $data_type Type of data to be removed.
	 * @param int    $user_id   ID of the user, as passed to 'delete_user'.
	 */
	return apply_filters( 'bp_remove_user_data_on_delete_user_hook', $remove, $component, $user_id );
}


Top ↑

Changelog Changelog

Changelog
Version Description
6.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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