WC_Customer::delete_and_reassign()publicWC 3.0.0

Delete a customer and reassign posts..

Method of the class: WC_Customer{}

No Hooks.

Return

true|false.

Usage

$WC_Customer = new WC_Customer();
$WC_Customer->delete_and_reassign( $reassign );
$reassign(int)
Reassign posts and links to new User ID.
Default: null

Changelog

Since 3.0.0 Introduced.

WC_Customer::delete_and_reassign() code WC 8.7.0

public function delete_and_reassign( $reassign = null ) {
	if ( $this->data_store ) {
		$this->data_store->delete(
			$this,
			array(
				'force_delete' => true,
				'reassign'     => $reassign,
			)
		);
		$this->set_id( 0 );
		return true;
	}
	return false;
}