WC_Log_Handler_DB::clear()publicWC 1.0

Clear entries for a chosen handle/source.

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

No Hooks.

Return

true|false.

Usage

$WC_Log_Handler_DB = new WC_Log_Handler_DB();
$WC_Log_Handler_DB->clear( $source );
$source(string) (required)
Log source.

Code of WC_Log_Handler_DB::clear() WC 6.8.2

public function clear( $source ) {
	global $wpdb;

	return $wpdb->query(
		$wpdb->prepare(
			"DELETE FROM {$wpdb->prefix}woocommerce_log WHERE source = %s",
			$source
		)
	);
}