[wp-trac] [WordPress Trac] #36687: Feature to override WP_Query to provide results from other source

WordPress Trac noreply at wordpress.org
Wed Apr 27 13:40:43 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:  Awaiting Review
Component:  Query            |    Version:
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 Currently the only way to get results is to query the database.
 We are currently working on a solution to utilize a solr server to
 retrieve post ids but there is no way to use WP_Query and return the
 results without actually hitting the database which defeats the purpose of
 having a solr server.

 The only solution right now is to implement all functionality we need by
 rewriting most of the widgets, plugins that query wordpress, to query solr
 in a totally custom way. This means that we cannot have a plugin that
 works universally for all to benefit from it without reinventing the wheel
 every time.

 It would be great to have an option in wp-includes/query.php to say that
 we have the results on hand, and don't go to the database.
 This is something that could be implemented early in wp-includes/query.php
 with an action and if $q contains lets say a key 'exit', then assume that
 we have posts and other needed variables filled in.

 I could provide a code sample if you see any interest in a feature like
 that.

 Regards

 Jean-Paul

--
Ticket URL: <https://core.trac.wordpress.org/ticket/36687>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list