• Resolved coadr93

    (@coadr93)


    Hi. I have to import a custom post type which has main image and secondary images in a gallery.

    I am using Administrator Pods plugin: https://www.ads-software.com/plugins/pods/

    Issue is… I can’t really import the images inside the Pods gallery using WP All Import.

    I exported a test one and it has WP database stuff like

    a:24:{s:2:”ID”;s:3:”455″;s:11:”post_author”;s:1:”2″;s:9:”post_date”;s:19:”2021-03-04 21:55:30″;s:13:”post_date_gmt”;s:19:”2021-03-04 21:55:30″;s:12:”post_content”;s:0:””;s:10:”post_title”;s:8:”grecia 9″;s:12:”post_excerpt”;s:0:””;s:11:”
    etc

    I tested with ACF gallery and it does a much simpler export, with filenames separated by |.

    Ex. img1.jpg|img2.jpg|img3.jpg etc

    But I don’t want to use ACF only for that, since pods can already do it.

    So I was wondering if this is possible with Pods Gallery and how can I use WP All Import to import the gallery images in my custom post types.

    I’ve already asked Pods support, here’s their reponse.

    https://www.ads-software.com/support/topic/gallery-plugin-export-import/#post-14726084

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author WP All Import

    (@wpallimport)

    Hey @coadr93,

    So I was wondering if this is possible with Pods Gallery and how can I use WP All Import to import the gallery images in my custom post types.

    Is the gallery a “File / Image / Video” field that allows multiple files? If so, you can import into it by importing images regularly and writing custom code that uses our API ( https://www.wpallimport.com/documentation/developers/action-reference/ ) to store the images as required by Pods.

    Here’s an example snippet that you can modify as needed:

    function wpai_pods_image_imported( $post_id, $att_id, $filepath, $is_keep_existing_images = '' ) {
         $pods_field_name = 'the_image_gallery';
         
         $existing = get_post_meta( '_pods_' . $pods_field_name, array() );
         
         if ( in_array( $att_id, $existing ) ) return;
         
         $existing[] = $att_id;
         add_post_meta( $post_id, $pods_field_name, $att_id );
    
    }
    add_action( 'pmxi_gallery_image', 'wpai_pods_image_imported', 10, 4 );
    Plugin Author WP All Import

    (@wpallimport)

    Hi @coadr93,

    I’m marking this as resolved since it’s been inactive for a while. Please open a new topic if you still have questions.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WP All Import Pods Gallery Field’ is closed to new replies.