Make WordPress Core

Opened 10 years ago

Closed 10 years ago

#22903 closed defect (bug) (duplicate)

*_image_link can fail for unattached media items on large sites

Reported by: batmoo's profile batmoo Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Media Keywords:
Focuses: Cc:


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.

Change History (1)

#1 @obenland
10 years ago

  • Component changed from General to Media
  • Milestone Awaiting Review deleted
  • Resolution set to duplicate
  • Status changed from new to closed

Closed in favor of #23044 since it's already in milestone and offers a temporary improvement.

Note: See TracTickets for help on using tickets.