[wp-trac] [WordPress Trac] #45298: Menu Quick Search: Allow searching for empty taxonomy terms

WordPress Trac noreply at wordpress.org
Tue Nov 6 11:08:25 UTC 2018


#45298: Menu Quick Search: Allow searching for empty taxonomy terms
----------------------------+-----------------------------
 Reporter:  birgire         |      Owner:  (none)
     Type:  defect (bug)    |     Status:  new
 Priority:  normal          |  Milestone:  Awaiting Review
Component:  Menus           |    Version:
 Severity:  normal          |   Keywords:  has-screenshots
  Focuses:  administration  |
----------------------------+-----------------------------
 In the ''Menu'' admin page {{{/wp-admin/nav-menus.php}}} we can view empty
 taxonomy terms, but we can't search for empty ones.

 This was reported here:
 https://wordpress.stackexchange.com/questions/302406/how-to-show-empity-
 category-in-admin-menus-search

 I had a look and found the same behavior in the Customizer.

 This seems like a bug.

 == Screenshots:

 See screenshots below for categories (same applies for other taxonomies).


 == Fixes:

 The default of {{{get_terms()}}} is to hide empty taxonomy terms.

 To fix this here, we need to add:

 {{{
 'hide_empty' => false,

 }}}

 to the input of {{{get_terms()}}} in {{{_wp_ajax_menu_quick_search()}}}:

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

 and to the input of {{{get_terms()}}} in
 {{{WP_Customize_Nav_Menus::search_available_items_query}}}:

 https://core.trac.wordpress.org/browser/tags/4.9.8/src/wp-includes/class-
 wp-customize-nav-menus.php#L352

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


More information about the wp-trac mailing list