• Resolved bgpress

    (@bgpress)


    Hello,

    I wrote a custom addon to import multiple images into a custom field, it looks so simple, but I am stuck.
    The field structure in the database looks clear, a simple serialized array:
    [a:10:{i:0;s:2:”26″;i:1;s:2:”27″;i:2;s:2:”28″;i:3;s:2:”29″;i:4;s:2:”30″;i:5;s:2:”31″;i:6;s:2:”32″;i:7;s:2:”33″;i:8;s:2:”34″;i:9;s:2:”35″;}]
    There are ten images in the array, each numbered and the gallery ID attached.
    The addon reference documentation says “Your add-on’s import function will be passed the image data as an array.”.
    The addon downloads the images to the media library, but the array does not show up in the custom field. Is there a difference between the source and target arrays?
    Any help appriciated.

    $estatik_addon->import_images( ‘property_images’, ‘Images for items’ );

    function estatik_img_addon_import($post_id, $data, $import_options) {
    global $estatik_addon;
    $key = ‘es_property_gallery’;
    add_post_meta( $post_id, $key, $data ) || update_post_meta( $post_id, $key, $data );
    }

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘multiple image import with custom addon’ is closed to new replies.