I have a list of attachment IDs which are built using this array:
$all_images = get_posts( array(
'post_type' => 'attachment',
'numberposts' => -1,
) );
Is it possible to take the image ID from this list and find the Title and permalink of the POST the image is attached to?
I know it's feasible because the Media Library shows it, but I can't find the right way to do this with the codex.
I have tried this code, however it returns the title and permalink to the attachment itself, not the post it's attached to:
$parent = get_post_field( 'post_parent', $imgID);
$link = get_permalink($parent);