bp_core_action_delete_user()

Process user deletion requests.

Description

Note: no longer used in the current state. See the Settings component.

Source

File: bp-core/deprecated/buddypress/3.0.php

function bp_core_action_delete_user() {
	_deprecated_function( __FUNCTION__, '3.0' );

	if ( !bp_current_user_can( 'bp_moderate' ) || bp_is_my_profile() || !bp_displayed_user_id() )
		return false;

	if ( bp_is_current_component( 'admin' ) && bp_is_current_action( 'delete-user' ) ) {

		// Check the nonce.
		check_admin_referer( 'delete-user' );

		$errors = false;
		do_action( 'bp_core_before_action_delete_user', $errors );

		if ( bp_core_delete_account( bp_displayed_user_id() ) ) {
			bp_core_add_message( sprintf( __( '%s has been deleted from the system.', 'buddyboss' ), bp_get_displayed_user_fullname() ) );
		} else {
			bp_core_add_message( sprintf( __( 'There was an error deleting %s from the system. Please try again.', 'buddyboss' ), bp_get_displayed_user_fullname() ), 'error' );
			$errors = true;
		}

		do_action( 'bp_core_action_delete_user', $errors );

		if ( $errors )
			bp_core_redirect( bp_displayed_user_domain() );
		else
			bp_core_redirect( bp_loggedin_user_domain() );
	}
}

Changelog

Changelog
Version Description
BuddyPress 3.0.0 Formally marked as deprecated. BuddyPress 3.0.0 Formally marked as deprecated.
BuddyPress 1.6.0 No longer used, unhooked. BuddyPress 1.6.0 No longer used, unhooked.
BuddyPress 1.1.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.