Automattic\WooCommerce\Admin
ReportCSVExporter::map_report_controller()
Get a REST controller instance for the report type.
Метод класса: ReportCSVExporter{}
Хуков нет.
Возвращает
true|false|WC_REST_Reports_Controller
. Report controller instance or boolean false on error.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->map_report_controller();
Код ReportCSVExporter::map_report_controller() ReportCSVExporter::map report controller WC 9.2.3
protected function map_report_controller() { // @todo - Add filter to this list. $controller_map = array( 'products' => 'Automattic\WooCommerce\Admin\API\Reports\Products\Controller', 'variations' => 'Automattic\WooCommerce\Admin\API\Reports\Variations\Controller', 'orders' => 'Automattic\WooCommerce\Admin\API\Reports\Orders\Controller', 'categories' => 'Automattic\WooCommerce\Admin\API\Reports\Categories\Controller', 'taxes' => 'Automattic\WooCommerce\Admin\API\Reports\Taxes\Controller', 'coupons' => 'Automattic\WooCommerce\Admin\API\Reports\Coupons\Controller', 'stock' => 'Automattic\WooCommerce\Admin\API\Reports\Stock\Controller', 'downloads' => 'Automattic\WooCommerce\Admin\API\Reports\Downloads\Controller', 'customers' => 'Automattic\WooCommerce\Admin\API\Reports\Customers\Controller', 'revenue' => 'Automattic\WooCommerce\Admin\API\Reports\Revenue\Stats\Controller', ); if ( isset( $controller_map[ $this->report_type ] ) ) { // Load the controllers if accessing outside the REST API. return new $controller_map[ $this->report_type ](); } // Should this do something else? return false; }