WC_Log_Handler_File::clear( string $handle )

Clear entries from chosen file.


Description Description


Parameters Parameters

$handle

(Required) Log handle.


Top ↑

Return Return

(bool)


Top ↑

Source Source

File: includes/log-handlers/class-wc-log-handler-file.php

	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;
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.