register_routes(); } /** * Add upload nonce to global JS settings. * * The value can be accessed at wcSettings.admin.blueprint_upload_nonce * * @param array $settings Global JS settings. * * @return array */ public function add_upload_nonce_to_settings( array $settings ) { if ( ! is_admin() ) { return $settings; } $page_id = PageController::get_instance()->get_current_screen_id(); if ( 'woocommerce_page_wc-admin' === $page_id ) { $settings['blueprint_upload_nonce'] = wp_create_nonce( 'blueprint_upload_nonce' ); return $settings; } return $settings; } /** * Add Woo Specific Exporters. * * @param StepExporter[] $exporters Array of step exporters. * * @return StepExporter[] */ public function add_woo_exporters( array $exporters ) { return array_merge( $exporters, array( new ExportWCCoreProfilerOptions(), new ExportWCSettings(), new ExportWCPaymentGateways(), new ExportWCShipping(), new ExportWCTaskOptions(), new ExportWCTaxRates(), ) ); } /** * Add Woo Specific Importers. * * @param StepProcessor[] $importers Array of step processors. * * @return array */ public function add_woo_importers( array $importers ) { return array_merge( $importers, array( new ImportSetWCPaymentGateways(), new ImportSetWCShipping(), new ImportSetWCTaxRates(), ) ); } }