[wp-trac] [WordPress Trac] #38589: hook 'get_terms_args' calls two times ...

WordPress Trac noreply at wordpress.org
Mon Oct 31 15:33:06 UTC 2016


#38589: hook 'get_terms_args' calls two times ...
--------------------------+------------------
 Reporter:  Tkama         |       Owner:
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  4.7
Component:  Taxonomy      |     Version:  4.6
 Severity:  normal        |  Resolution:
 Keywords:                |     Focuses:
--------------------------+------------------
Changes (by boonebgorges):

 * focuses:  administration =>
 * component:  General => Taxonomy
 * version:  4.6.1 => 4.6
 * milestone:  Awaiting Review => 4.7


Comment:

 Hi @Tkama - Thank you for the ticket, and welcome to WordPress Trac!

 You're correct that it's illogical to call the 'get_terms_args' filter
 twice. This problem was introduced in [37572] along with `WP_Term_Query`.
 I believe that the error can be explained like this: Prior to [37572],
 'get_terms_args' had been applied in `get_terms()`, after the defaults had
 been set up. (This usage dates back many versions.) But `parse_query()`
 seems, in some abstract sense, like the "right" place for the filter to
 live, which is why I assume it was introduced in [37572].

 I think the correct fix is to remove the 'get_terms_args' filter in
 `WP_Term_Query::parse_query()`, but I'd like a second opinion on that
 before moving forward. @flixos90, since you drafted the original patch,
 could I ask for your thoughts?

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


More information about the wp-trac mailing list