[wp-trac] [WordPress Trac] #22903: *_image_link can fail for unattached media items on large sites
WordPress Trac
noreply at wordpress.org
Thu Dec 13 02:20:16 UTC 2012
#22903: *_image_link can fail for unattached media items on large sites
-----------------------------+--------------------------
Reporter: batmoo | Type: defect (bug)
Status: new | Priority: normal
Milestone: Awaiting Review | Component: General
Version: | Severity: normal
Keywords: |
-----------------------------+--------------------------
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.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/22903>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list