BP_Xprofile_Export::process_erase( $user,  $page, bool $email_address )

Delete member extended profile fields.

Description

Parameters

$user

(Required)

$page

(Required)

$email_address

(Required)

Return

(array)

Source

File: bp-core/gdpr/class-bp-xprofile-export.php

	function process_erase( $user, $page, $email_address ) {

		global $wpdb;

		if ( ! $user || is_wp_error( $user ) ) {
			return $this->response_erase( array(), true );
		}

		$number         = $this->items_per_batch;
		$page           = (int) $page;
		$items_removed  = true;
		$items_retained = false;

		/**
		 * Make use of buddypress default data remover.
		 */
		xprofile_remove_data( $user->ID );

		// delete avatar
		bp_core_delete_avatar_on_user_delete( $user->ID );

		// delete cover photo
		bp_attachments_delete_file( array( 'item_id' => $user->ID, 'object' => 'members', 'type' => 'cover-image' ) );

		$done = true;

		return $this->response_erase( $items_removed, $done, array(), $items_retained );
	}

Changelog

Changelog
Version Description
BuddyBoss 1.0.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.