[wp-trac] [WordPress Trac] #39354: Unable to filter term query args using `pre_get_terms` action

WordPress Trac noreply at wordpress.org
Wed Dec 21 00:31:37 UTC 2016


#39354: Unable to filter term query args using `pre_get_terms` action
--------------------------+-----------------------------
 Reporter:  jfarthing84   |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.7
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 Thus making the action practically useless. But fear not, there is a
 simple remedy. In fact, the same remedy is used in `WP_Query::get_posts`!
 Use a reference within `WP_Term_Query::get_terms` to access the query vars
 locally:

 {{{#!php
 $args = &$this->query_vars;
 }}}

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


More information about the wp-trac mailing list