Skip to content
This repository was archived by the owner on Jan 6, 2025. It is now read-only.

Commit 7019f2e

Browse files
committed
Added assets container to config
1 parent 7a4b3d8 commit 7019f2e

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

README.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ By the time you read this there might be others. Consult [the documentation](htt
4141

4242
### A note regarding images
4343

44-
Only the featured image will be downloaded. Multiple featured images, images added with ACF and other plugins, are not downloaded. Featured images will be downloaded to the "assets" container into a folder called "{collection_handle}/{entry_slug}", and saved on a field on the entry called "featured_image".
44+
Only the featured image will be downloaded. Multiple featured images, images added with ACF and other plugins, are not downloaded. Featured images will be downloaded to the "assets" container by default, into a folder called "{collection_handle}/{entry_slug}", and saved on a field on the entry called "featured_image".
4545

4646
You can use the events above to do your own downloading of images and what not. I have done this myself with great success 👍
4747

@@ -79,6 +79,11 @@ return [
7979
*/
8080
'download_images' => true,
8181
82+
/**
83+
* The name of the assets container where images should be downloaded.
84+
*/
85+
'assets_container' => 'assets',
86+
8287
/*
8388
* Whether to skip download of an image if it already exist. The default is 'false'.
8489
*/

config/statamic-wp-import.php

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
*/
88
'download_images' => true,
99

10+
/**
11+
* The name of the assets container where images should be downloaded.
12+
*/
13+
'assets_container' => 'assets',
14+
1015
/*
1116
* Whether to skip download of an image if it already exist. The default is 'false'.
1217
*/

src/Helpers/Migrator.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ private function downloadAsset(string $url = null, string $collection, string $s
262262

263263
Storage::put($tempFile = 'temp', $image);
264264

265-
$assetContainer = AssetContainer::findByHandle('assets');
265+
$assetContainer = AssetContainer::findByHandle(config('statamic-wp-import.assets_container'));
266266

267267
$asset = $assetContainer->makeAsset("{$collection}/{$slug}/{$originalImageName}");
268268

0 commit comments

Comments
 (0)