WC_Log_Handler_File::clear()
Clear entries from chosen file.
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.
WC_Log_Handler_File::clear() WC Log Handler File::clear code WC 9.5.1
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; }