Support

Account

Home Forums Add-ons Gallery Field Upload Image from External URL and add to ACF Gallery Reply To: Upload Image from External URL and add to ACF Gallery

  • Thanks a lot, i can now can upload images from external url and add them all to ACF Gallery.

    still there is one more problem.
    i’m using these line of codes:

    // Set Fetched ArtWork as Post Thumbnail
    $DownloadArtWork_Importer = media_sideload_image( $data['download_artwork'], $post_id, null, 'id' );
    set_post_thumbnail( $post_id, $DownloadArtWork_Importer );
    
    // Set Fetched ScreenShots as Post Gallery
    $DownloadScreenShot_Importer = array($data['download_screenshots']);
    foreach($DownloadScreenShots as $DownloadScreenShot) {
    	$DownloadScreenShot_Importer[] = media_sideload_image( $DownloadScreenShot, $post_id, NULL, 'id');
    }
    update_field( 'field_5d94fb71cf60f', $DownloadScreenShot_Importer , $post_id );	

    the ArtWork image (thumbnail) is attached to current post but screenshots (Gallery images) are not attached to wp post.

    see screenshot below please:
    ScreenShot

    i know it’s probably from WP not ACF but i’ll appreciate it if you can give me hint on how can i attach gallery images to wp post just like thumbnail …