[wp-trac] [WordPress Trac] #16894: Bulk load Comment Meta upon access
WordPress Trac
noreply at wordpress.org
Thu Sep 10 01:35:52 UTC 2015
#16894: Bulk load Comment Meta upon access
--------------------------+--------------------------
Reporter: dd32 | Owner: bradt
Type: defect (bug) | Status: reopened
Priority: normal | Milestone: 4.4
Component: Comments | Version: 3.1
Severity: normal | Resolution:
Keywords: has-patch | Focuses: performance
--------------------------+--------------------------
Changes (by wonderboymusic):
* keywords: has-patch commit => has-patch
Comment:
Yeah, there's a lot going on. The `WP_Query` flag is only useful in the
loop. The patch on the ticket essentially made this so by checking the
global, which is only set in `wp_list_comments()`, which only works if
comments are passed to it (they never are in core) or is `$wp_query` has
the `->comments` prop populated, which only happens when
`comments_template()` is called. `WP_Query` doesn't eager-load comments,
it is decorated by `comments_template()`. That's why I quarantined the
code to `wp_list_comments()`.
I'm not sure any of this needed without a better overall strategy.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/16894#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list