[wp-trac] [WordPress Trac] #41246: Filter to short circuit term query

WordPress Trac noreply at wordpress.org
Wed Jul 5 17:36:34 UTC 2017


#41246: Filter to short circuit term query
-------------------------+-----------------------------
 Reporter:  jarocks      |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Taxonomy     |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 It would be nice to be able to effectively short-circuit a terms query so
 that you could return results from an external data source (`WP_Query`
 already has a filter like this in the form of `posts_pre_query`). My patch
 would add a similar filter `terms_pre_query` into the `::parse_query()`
 method of the `WP_Term_Query` class.

 This is more a proof of concept than anything else, I'm not sure if it
 makes sense to leave the burden of handling term caching as well as the
 hide_empty and the pad_counts parameters on the callback function.
 Hopefully some more experienced contributors will have some better insight
 into that.

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


More information about the wp-trac mailing list