[wp-trac] [WordPress Trac] #40661: WP_Term_Query->parse_query() needs filter like 'get_terms'

WordPress Trac noreply at wordpress.org
Sun Jul 30 15:43:33 UTC 2017


#40661: WP_Term_Query->parse_query() needs filter like 'get_terms'
------------------------------------------+------------------------------
 Reporter:  mpol                          |       Owner:
     Type:  enhancement                   |      Status:  new
 Priority:  normal                        |   Milestone:  Awaiting Review
Component:  Taxonomy                      |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-unit-tests needs-patch  |     Focuses:
------------------------------------------+------------------------------

Comment (by boonebgorges):

 Thanks, @mpol!

 Having the filter placed as in [attachment:filter-term-query-
 results.patch] means that the cache will be populated with items returned
 from filters. This seems problematic to me, since an error by a developer
 could result in incorrectly cached content. Moreover, it means that the
 filter will run on values coming from a database query *as well as* values
 coming out of the cache, when the latter will already have been cached on
 the way into the database. As such, I'd suggest moving the filter so that
 it runs on what's been pulled from the cache. Does that seem right?

 Note that the approach here (especially in light of the preceding
 paragraph) will probably need revisiting after #37189.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/40661#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list