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

WordPress Trac noreply at wordpress.org
Thu May 4 10:28:29 UTC 2017


#40661: WP_Term_Query->parse_query() needs filter like 'get_terms'
--------------------------+-----------------------------
 Reporter:  mpol          |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Taxonomy      |    Version:  trunk
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 The new class/method WP_Term_Query->parse_query() does not provide a
 filter like the old function get_terms() does. Using WP_Term_Query
 directly has thus different functionality from using the old wp_terms
 function.

 Using a plugin like:
 https://wordpress.org/support/plugin/custom-taxonomy-order-ne/
 with a custom term_order field and sorting based on that, gives the
 default sort based on name.
 Adding a filter to the method like get_terms, provides backwards
 compatibility for plugin and theme authors, that are switching to
 WP_Term_Query directly.
 This filter gives options to apply a custom order to the list of terms.

 Reference on support forum:
 https://wordpress.org/support/topic/doesnt-reorder-when-using-
 wp_term_query/

 If adding a filter is somehow not wanted by core devs, then I will have to
 answer to add this filter manually to the code when support requests are
 coming. To be clear, I would consider that a valid response.

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


More information about the wp-trac mailing list