Retrieve array of attachment IDs attached to a given Post ID
found a solution: thought it might be worth sharing… //// We use $gallery_media as an array containing all attachment IDs that have been approved by the admin before $args = array( ‘post_type’ => ‘attachment’, ‘posts_per_page’ => -1, ‘orderby’ => ‘post_date’, ‘order’ => ‘ASC’, ‘post_status’ =>’any’, ‘post_parent’ => $post->ID, // This queries a custom field I … Read more