WordPress at Your Fingertips
function is not described

WC_Log_Handler_File::remove() public WC 1.0

Remove/delete the 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->remove( $handle );
$handle(string) (required)
Log handle.

Code of WC_Log_Handler_File::remove() WC 5.8.0

public function remove( $handle ) {
	$removed = false;
	$logs    = $this->get_log_files();
	$handle  = sanitize_title( $handle );

	if ( isset( $logs[ $handle ] ) && $logs[ $handle ] ) {
		$file = realpath( trailingslashit( WC_LOG_DIR ) . $logs[ $handle ] );
		if ( 0 === stripos( $file, realpath( trailingslashit( WC_LOG_DIR ) ) ) && is_file( $file ) && is_writable( $file ) ) { // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_is_writable
			$this->close( $file ); // Close first to be certain no processes keep it alive after it is unlinked.
			$removed = unlink( $file ); // phpcs:ignore WordPress.VIP.FileSystemWritesDisallow.file_ops_unlink
		}
		do_action( 'woocommerce_log_remove', $handle, $removed );
	}
	return $removed;
}