WordPress at Your Fingertips
function is not described

WC_Log_Handler_File::clear() public WC 1.0

Clear entries from chosen file.

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

Hooks from the method

Return

true|false.

Usage

$WC_Log_Handler_File = new WC_Log_Handler_File();
$WC_Log_Handler_File->clear( $handle );
$handle(string) (required)
Log handle.

Code of WC_Log_Handler_File::clear() WC 5.8.0

public function clear( $handle ) {
	$result = false;

	// Close the file if it's already open.
	$this->close( $handle );

	/**
	 * $this->open( $handle, 'w' ) == Open the file for writing only. Place the file pointer at
	 * the beginning of the file, and truncate the file to zero length.
	 */
	if ( $this->open( $handle, 'w' ) && is_resource( $this->handles[ $handle ] ) ) {
		$result = true;
	}

	do_action( 'woocommerce_log_clear', $handle );

	return $result;
}