WC_Admin_Status::flush_db_logs()private staticWC 3.0.0

Clear DB log table.

Method of the class: WC_Admin_Status{}

No Hooks.

Return

null. Nothing (null).

Usage

$result = WC_Admin_Status::flush_db_logs();

Changelog

Since 3.0.0 Introduced.

WC_Admin_Status::flush_db_logs() code WC 8.6.1

private static function flush_db_logs() {
	check_admin_referer( 'bulk-logs' );

	if ( ! current_user_can( 'manage_woocommerce' ) ) {
		wp_die( esc_html__( 'You do not have permission to manage log entries.', 'woocommerce' ) );
	}

	WC_Log_Handler_DB::flush();

	$sendback = wp_sanitize_redirect( admin_url( 'admin.php?page=wc-status&tab=logs' ) );

	wp_safe_redirect( $sendback );
	exit;
}