Automattic\WooCommerce\Internal\Admin\ImportExport
CSVUploadHelper::remove_txt_from_uploaded_file()
wp_import_handle_upload() .txt to any file name. This function is hooked onto wp_handle_upload_prefilter remove those extra characters.
Метод класса: CSVUploadHelper{}
Хуков нет.
Возвращает
Массив
. Modified file details.
Использование
// private - только в коде основоного (родительского) класса $result = $this->remove_txt_from_uploaded_file( $file ): array;
- $file(массив) (обязательный)
- File details in the form of a $_FILES entry.
Код CSVUploadHelper::remove_txt_from_uploaded_file() CSVUploadHelper::remove txt from uploaded file WC 9.3.3
private function remove_txt_from_uploaded_file( array $file ): array { $file['name'] = substr( $file['name'], 0, -4 ); return $file; }