[wp-trac] [WordPress Trac] #36687: Feature to override WP_Query to provide results from other source
WordPress Trac
noreply at wordpress.org
Sat May 14 12:35:12 UTC 2016
#36687: Feature to override WP_Query to provide results from other source
-----------------------------------+-----------------------------
Reporter: jpdavoutian | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: Future Release
Component: Query | Version:
Severity: normal | Resolution:
Keywords: has-patch 2nd-opinion | Focuses:
-----------------------------------+-----------------------------
Comment (by jpdavoutian):
@boonebgorges I have to confess that the variable names I used are not
very descriptive and sorry for not having any comments in the changes. I
forgot completely about them.
As for the query parameter. It is not about disabling WP_Query's database
query but to avoid making the external call. For example when indexing
posts for the solr server we need to explicitly use the database.
Otherwise we cannot read the posts. That's why I think that we should have
the option there. The default should be that we want make the external
call since the cases that we require explicit database use are less. Maybe
a better name and comments in code will help.
As for the set_found_posts(). You are right that the number of posts comes
with the results, even with paging. So there is no reason to make an extra
call if we have this number on hand. Besides from settings the
$query->found_posts I cannot figure out any other way.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/36687#comment:10>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list