[wp-trac] [WordPress Trac] #45800: Add short circuits for WP_Comment_Query
WordPress Trac
noreply at wordpress.org
Mon Aug 19 18:54:02 UTC 2019
#45800: Add short circuits for WP_Comment_Query
-------------------------------------------------+-------------------------
Reporter: spacedmonkey | Owner:
| adamsilverstein
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.3
Component: Comments | Version: 3.1
Severity: normal | Resolution:
Keywords: has-patch has-unit-tests dev- | Focuses:
feedback needs-dev-note |
-------------------------------------------------+-------------------------
Comment (by adamsilverstein):
> If so, let me just leave a reminder here: as we are exiting from
get_comments() earlier, we should cast those objects into WP_Comment
instances. get_comments() has a $comments = array_map( 'get_comment',
$_comments ); near its end and it won't be executed in short-circuited
cases.
We leave it up the the filter consumer to handle the proper return format,
if the request args are for 'fields' => 'ids' the expected return is ids
instead of comment objects.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/45800#comment:23>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list