WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта с помощью браузерных PUSH уведомлений
функция не описана

WC_Product_CSV_Importer::read_file() protected WC 1.0

Read file.

{} Это метод класса: WC_Product_CSV_Importer{}

Хуков нет.

Возвращает

null. Ничего.

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

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

Код WC_Product_CSV_Importer::read_file() WC 5.2.2

<?php
protected function read_file() {
	if ( ! WC_Product_CSV_Importer_Controller::is_file_valid_csv( $this->file ) ) {
		wp_die( esc_html__( 'Invalid file type. The importer supports CSV and TXT file formats.', 'woocommerce' ) );
	}

	$handle = fopen( $this->file, 'r' ); // @codingStandardsIgnoreLine.

	if ( false !== $handle ) {
		$this->raw_keys = version_compare( PHP_VERSION, '5.3', '>=' ) ? array_map( 'trim', fgetcsv( $handle, 0, $this->params['delimiter'], $this->params['enclosure'], $this->params['escape'] ) ) : array_map( 'trim', fgetcsv( $handle, 0, $this->params['delimiter'], $this->params['enclosure'] ) ); // @codingStandardsIgnoreLine

		// Remove BOM signature from the first item.
		if ( isset( $this->raw_keys[0] ) ) {
			$this->raw_keys[0] = $this->remove_utf8_bom( $this->raw_keys[0] );
		}

		if ( 0 !== $this->params['start_pos'] ) {
			fseek( $handle, (int) $this->params['start_pos'] );
		}

		while ( 1 ) {
			$row = version_compare( PHP_VERSION, '5.3', '>=' ) ? fgetcsv( $handle, 0, $this->params['delimiter'], $this->params['enclosure'], $this->params['escape'] ) : fgetcsv( $handle, 0, $this->params['delimiter'], $this->params['enclosure'] ); // @codingStandardsIgnoreLine

			if ( false !== $row ) {
				$this->raw_data[]                                 = $row;
				$this->file_positions[ count( $this->raw_data ) ] = ftell( $handle );

				if ( ( $this->params['end_pos'] > 0 && ftell( $handle ) >= $this->params['end_pos'] ) || 0 === --$this->params['lines'] ) {
					break;
				}
			} else {
				break;
			}
		}

		$this->file_position = ftell( $handle );
	}

	if ( ! empty( $this->params['mapping'] ) ) {
		$this->set_mapped_keys();
	}

	if ( $this->params['parse'] ) {
		$this->set_parsed_data();
	}
}