Home Forums Add-ons Gallery Field Load images into Gallery in code Reply To: Load images into Gallery in code

  • Thanks John! I knew that, but your message sparked me to look from another angle!

    I had this:
    $value = array(array('ID' => '253'), array('ID' => '170'));

    But, it should be this:
    $value = array('253', '170');

    Used this full function:

    //IMAGES field
    	function load_team_summary_images( $value, $post_id, $field ){
    	    global $allUpdatesImages;
    	    $value = $allUpdatesImages;
    	    return $value;
    	add_filter('acf/load_value/key=field_564900d0c98d1', 'load_team_summary_images', 10, 3);

    Works perfectly. I am attaching the images (from a Gallery field) to the post, so I used get_attached_media('image', $oUpdateID); with the post ID to get all the IDs of the attached media.