WC_Product_CSV_Importer_Controller::mapping_form()protectedWC 1.0

Mapping step.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->mapping_form();

Код WC_Product_CSV_Importer_Controller::mapping_form() WC 8.7.0

protected function mapping_form() {
	check_admin_referer( 'woocommerce-csv-importer' );
	$args = array(
		'lines'              => 1,
		'delimiter'          => $this->delimiter,
		'character_encoding' => $this->character_encoding,
	);

	$importer     = self::get_importer( $this->file, $args );
	$headers      = $importer->get_raw_keys();
	$mapped_items = $this->auto_map_columns( $headers );
	$sample       = current( $importer->get_raw_data() );

	if ( empty( $sample ) ) {
		$this->add_error(
			__( 'The file is empty or using a different encoding than UTF-8, please try again with a new file.', 'woocommerce' ),
			array(
				array(
					'url'   => admin_url( 'edit.php?post_type=product&page=product_importer' ),
					'label' => __( 'Upload a new file', 'woocommerce' ),
				),
			)
		);

		// Force output the errors in the same page.
		$this->output_errors();
		return;
	}

	include_once dirname( __FILE__ ) . '/views/html-csv-import-mapping.php';
}