Automattic\WooCommerce\Admin

ReportsSync::delete_report_data()public staticWC 1.0

Delete all data for reports.

Method of the class: ReportsSync{}

No Hooks.

Return

String.

Usage

$result = ReportsSync::delete_report_data();

ReportsSync::delete_report_data() code WC 7.1.0

public static function delete_report_data() {
	// Cancel all pending import jobs.
	self::clear_queued_actions();

	foreach ( self::get_schedulers() as $scheduler ) {
		$scheduler::schedule_action( 'delete_batch_init', array() );
	}

	// Delete import options.
	delete_option( ImportScheduler::IMPORT_STATS_OPTION );

	return __( 'Report table data is being deleted.', 'woocommerce' );
}