WC_Admin_Status::flush_db_logs()private staticWC 3.0.0

Clear DB log table.

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

No Hooks.

Return

null. Nothing.

Usage

$result = WC_Admin_Status::flush_db_logs();

Changelog

Since 3.0.0 Introduced.

Code of WC_Admin_Status::flush_db_logs() WC 6.7.0

private static function flush_db_logs() {
	if ( empty( $_REQUEST['_wpnonce'] ) || ! wp_verify_nonce( $_REQUEST['_wpnonce'], 'woocommerce-status-logs' ) ) { // WPCS: input var ok, sanitization ok.
		wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'woocommerce' ) );
	}

	WC_Log_Handler_DB::flush();

	wp_safe_redirect( esc_url_raw( admin_url( 'admin.php?page=wc-status&tab=logs' ) ) );
	exit();
}