WordPress at Your Fingertips
function is not described

WC_Data::delete() public WC 2.6.0

Delete an object, set the ID to 0, and return result.

{} It's a method of the class: WC_Data{}

No Hooks.

Return

true|false. result

Usage

$WC_Data = new WC_Data();
$WC_Data->delete( $force_delete );
$force_delete(true|false)
Should the date be deleted permanently.

Changelog

Since 2.6.0 Introduced.

Code of WC_Data::delete() WC 5.5.2

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