Amazing plugin. You can use it with WP All Import also.
-
I want to let you know that it is the perfect plugin for remote images. The solution if you are using WP All Import and you get the images from lets say {photos/photo} (this returns all the images separated by comma), is to create two functions that creates the serialized data to use it in custom fields:
function get_featured_image($photos) {
if (empty($photos)) return 'NO_PHOTOS';
if (!is_array($photos)) {
$photos = explode(',', $photos);
}
$first = trim($photos[0]);
return serialize([
'img_url' => $first,
'width' => '',
'height' => ''
]);
}
function get_gallery_images($photos) {
if (empty($photos)) return '';
if (!is_array($photos)) {
$photos = explode(',', $photos);
}
if (count($photos) < 2) return '';
$gallery = [];
for ($i = 1; $i < count($photos); $i++) {
$url = trim($photos[$i]);
$gallery[] = [
'url' => $url,
'width' => '',
'height' => ''
];
}
return serialize($gallery);
}Then you just create a custom field for the featured image with name “_harikrutfiwu_url” and value: [get_featured_image({photos/photo})]
And a custom field for gallery images with name “_harikrutfiwu_wcgallary” and value: [get_gallery_images({photos/photo})]
That’s all.
Happy Import with this amazing plugin.
The topic ‘Amazing plugin. You can use it with WP All Import also.’ is closed to new replies.