Automattic\WooCommerce\Internal\Admin\ImportExport

CSVUploadHelper::override_upload_dir()privateWC 1.0

Hooked onto upload_dir override the default upload directory for a CSV upload.

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

Хуков нет.

Возвращает

Массив.

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

// private - только в коде основоного (родительского) класса
$result = $this->override_upload_dir( $uploads ): array;
$uploads(массив) (обязательный)
WP upload dir details.

Код CSVUploadHelper::override_upload_dir() WC 9.3.3

private function override_upload_dir( $uploads ): array {
	$new_subdir = '/' . $this->get_import_subdir_name();

	$uploads['path']   = $uploads['basedir'] . $new_subdir;
	$uploads['url']    = $uploads['baseurl'] . $new_subdir;
	$uploads['subdir'] = $new_subdir;

	return $uploads;
}