Automattic\WooCommerce\Admin

ReportExporter::get_export_percentage_complete()public staticWC 1.0

Get the completion percentage of a report export.

Метод класса: ReportExporter{}

Хуков нет.

Возвращает

true|false|int. Completion percentage, or false if export not found.

Использование

$result = ReportExporter::get_export_percentage_complete( $report_type, $export_id );
$report_type(строка) (обязательный)
Report type. E.g. 'customers'.
$export_id(строка) (обязательный)
Unique ID for report (timestamp expected).

Код ReportExporter::get_export_percentage_complete() WC 8.7.0

public static function get_export_percentage_complete( $report_type, $export_id ) {
	$exports_status = get_option( self::EXPORT_STATUS_OPTION, array() );
	$status_key     = self::get_status_key( $report_type, $export_id );

	if ( isset( $exports_status[ $status_key ] ) ) {
		return $exports_status[ $status_key ];
	}

	return false;
}