Automattic\WooCommerce\Admin

ReportCSVExporter::get_report_controllerpublic staticWC 11.0.1

Get a REST controller instance for a given report type, or false if unknown.

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

Хуков нет.

Возвращает

\WC_REST_Reports_Controller|false.

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

$result = ReportCSVExporter::get_report_controller( $report_type );
$report_type(строка) (обязательный)
Report type. E.g. 'orders'.

Список изменений

С версии 11.0.1 Введена.

Код ReportCSVExporter::get_report_controller() WC 11.1.2

public static function get_report_controller( $report_type ) {
	$controller_map = self::get_report_controller_map();

	if ( ! isset( $controller_map[ $report_type ] ) ) {
		return false;
	}

	$controller = new $controller_map[ $report_type ]();

	return $controller instanceof \WC_REST_Reports_Controller ? $controller : false;
}