*_image_link can fail for unattached media items on large sites
|Reported by:||batmoo||Owned by:|
On a site with many unattached media items (e.g. ~25,000), use of the *_image_link functions can fail.
This is because the adjancent_image_link function makes a get_children call with post_parent = 0, causing all unattached media items to be returned.
One possible optimization would be to return only IDs but that's likely to still fail when the unattached count is in the tens of thousands. It would be better to only query for the ID of the adjancent post.