Automattic\WooCommerce\Internal\Admin\ImportExport
CSVUploadHelper::get_import_dir
Returns the full path to the CSV import directory within the uploads folder. It will attempt to create the directory if it doesn't exist.
Метод класса: CSVUploadHelper{}
Хуков нет.
Возвращает
Строку.
Использование
$CSVUploadHelper = new CSVUploadHelper(); $CSVUploadHelper->get_import_dir( $create ): string;
- $create(true|false)
- TRUE to attempt to create the directory. FALSE otherwise.
По умолчанию: true
Код CSVUploadHelper::get_import_dir() CSVUploadHelper::get import dir WC 10.3.4
public function get_import_dir( bool $create = true ): string {
$wp_upload_dir = wp_upload_dir( null, $create );
if ( $wp_upload_dir['error'] ) {
throw new \Exception( esc_html( $wp_upload_dir['error'] ) );
}
$upload_dir = trailingslashit( $wp_upload_dir['basedir'] ) . $this->get_import_subdir_name();
if ( $create ) {
FilesystemUtil::mkdir_p_not_indexable( $upload_dir );
}
return $upload_dir;
}