[wp-trac] [WordPress Trac] #45297: _wp_ajax_menu_quick_search: Deprecated taxonomy input for get_terms

WordPress Trac noreply at wordpress.org
Tue Nov 6 10:03:05 UTC 2018


#45297: _wp_ajax_menu_quick_search: Deprecated taxonomy input for get_terms
----------------------------+-----------------------------
 Reporter:  birgire         |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Taxonomy        |    Version:  4.5
 Severity:  normal          |   Keywords:  has-patch
  Focuses:  administration  |
----------------------------+-----------------------------
 In [https://core.trac.wordpress.org/browser/tags/4.9.8/src/wp-
 admin/includes/nav-menu.php#L109 _wp_ajax_menu_quick_search()] the
 taxonomy input is deprecated since 4.5.

 The taxonomy input for {{{get_terms()}}} should now be part of the
 argument array.

 See e.g.

 https://developer.wordpress.org/reference/functions/get_terms/

 So we need to change:

 {{{
 $terms = get_terms( $matches[2], array(
     'name__like' => $query,
     'number' => 10,
 ));

 }}}

 in https://core.trac.wordpress.org/browser/tags/4.9.8/src/wp-
 admin/includes/nav-menu.php#L109

 to

 {{{
 $terms = get_terms(
     array(
         'taxonomy'   => $matches[2],
         'name__like' => $query,
         'number'     => 10,
     )
 );

 }}}

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


More information about the wp-trac mailing list