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.
Использование
$CSVUploadHelper = new CSVUploadHelper(); $CSVUploadHelper->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 10.3.4
public function remove_txt_from_uploaded_file( array $file ): array {
$file['name'] = substr( $file['name'], 0, -4 );
return $file;
}